#REFACTORING
authorStefan Vogel <sv@exept.de>
Tue, 13 Oct 2015 13:28:49 +0200
changeset 7038 94deb70cb1cd
parent 7031 4c8433396e20
child 7039 83c687ad08b6
child 7040 9de35e2b291f
#REFACTORING class: WindowingTransformation added: #transformRectangle:
WindowingTransformation.st
--- a/WindowingTransformation.st	Sun Oct 11 10:31:10 2015 +0200
+++ b/WindowingTransformation.st	Tue Oct 13 13:28:49 2015 +0200
@@ -511,6 +511,21 @@
         ^ p * scale
     ].
     ^ (p * scale + translation)
+!
+
+transformRectangle:rect 
+    "Apply the receiver to a point, returning a new point."
+
+    scale isNil ifTrue:[
+        translation isNil ifTrue:[
+            ^ rect.
+        ].
+        ^ rect + translation
+    ].
+    translation isNil ifTrue:[
+        ^ rect scaledBy: scale
+    ].
+    ^ (rect scaledBy: scale) + translation
 ! !
 
 !WindowingTransformation methodsFor:'printing & storing'!
@@ -625,10 +640,10 @@
 !WindowingTransformation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/WindowingTransformation.st,v 1.27 2015-01-22 14:23:53 cg Exp $'
+    ^ '$Header$'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/WindowingTransformation.st,v 1.27 2015-01-22 14:23:53 cg Exp $'
+    ^ '$Header$'
 ! !