class: DisplayTransform
authorClaus Gittinger <cg@exept.de>
Sun, 21 Dec 2014 23:23:28 +0100
changeset 3427 a1c13cf17554
parent 3426 22e436474a5e
child 3428 afbce13bb9c2
class: DisplayTransform added: #isNoScale #noScale comment/format in: #setIdentity
DisplayTransform.st
--- a/DisplayTransform.st	Sun Dec 21 22:24:04 2014 +0100
+++ b/DisplayTransform.st	Sun Dec 21 23:23:28 2014 +0100
@@ -94,8 +94,9 @@
 !DisplayTransform methodsFor:'initialize'!
 
 setIdentity
-	"Initialize the receiver to the identity transformation (e.g., not affecting points)"
-	^self subclassResponsibility
+    "Initialize the receiver to the identity transformation (e.g., not affecting points)"
+
+    ^self subclassResponsibility
 ! !
 
 !DisplayTransform methodsFor:'testing'!
@@ -121,6 +122,16 @@
 	^false
 !
 
+isNoScale
+    "return true if the identity scale is in effect (i.e. saleFactor is 1);
+     return false, otherwise."
+
+    |s|
+
+    s := self scale.
+    ^ s x = 1 and:[s y = 1]
+!
+
 isPureTranslation
 	"Return true if the receiver specifies no rotation or scaling."
 	^self subclassResponsibility
@@ -179,6 +190,10 @@
 !DisplayTransform class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/DisplayTransform.st,v 1.2 2014-12-21 21:20:45 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/DisplayTransform.st,v 1.3 2014-12-21 22:23:28 cg Exp $'
+!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/libview2/DisplayTransform.st,v 1.3 2014-12-21 22:23:28 cg Exp $'
 ! !