# HG changeset patch # User Claus Gittinger # Date 1419200608 -3600 # Node ID a1c13cf175540476bc96447af4a6ad9e0e79c9a0 # Parent 22e436474a5ea9e6bc655f0f3745f19be1d33ed6 class: DisplayTransform added: #isNoScale #noScale comment/format in: #setIdentity diff -r 22e436474a5e -r a1c13cf17554 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 $' ! !