TranslatingWrapper.st
changeset 2663 baea7b430705
parent 1789 f52f0a0d8448
child 3855 1db7742d33ad
equal deleted inserted replaced
2662:c8338281bc33 2663:baea7b430705
     7  inclusion of the above copyright notice.   This software may not
     7  inclusion of the above copyright notice.   This software may not
     8  be provided or otherwise made available to, or used by, any
     8  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 
       
    13 
       
    14 "{ Package: 'stx:libview2' }"
    12 "{ Package: 'stx:libview2' }"
    15 
    13 
    16 Wrapper subclass:#TranslatingWrapper
    14 Wrapper subclass:#TranslatingWrapper
    17 	instanceVariableNames:'origin'
    15 	instanceVariableNames:'origin'
    18 	classVariableNames:''
    16 	classVariableNames:''
   186 
   184 
   187     |delta|
   185     |delta|
   188 
   186 
   189     delta := originPoint - origin.
   187     delta := originPoint - origin.
   190     origin := originPoint.
   188     origin := originPoint.
   191     bounds := bounds origin + origin extent:bounds extent.
   189     frame := frame origin + origin extent:frame extent.
   192     component bounds:(component bounds + delta).
   190     component bounds:(component bounds + delta).
   193 
   191 
   194     "Created: 26.5.1996 / 16:07:47 / cg"
   192     "Created: 26.5.1996 / 16:07:47 / cg"
   195     "Modified: 5.6.1996 / 02:37:27 / cg"
   193     "Modified: 5.6.1996 / 02:37:27 / cg"
   196 ! !
   194 ! !
   197 
   195 
   198 !TranslatingWrapper methodsFor:'accessing - bounds'!
   196 !TranslatingWrapper methodsFor:'accessing - bounds'!
   199 
   197 
   200 bounds:newBounds
   198 bounds:newBounds
   201     bounds := newBounds.
   199     frame := newBounds.
   202     origin = 0 ifTrue:[
   200     origin = 0 ifTrue:[
   203         component bounds:newBounds
   201         component bounds:newBounds
   204     ] ifFalse:[
   202     ] ifFalse:[
   205         component bounds:(newBounds origin - origin extent:(newBounds extent)).
   203         component bounds:(newBounds origin - origin extent:(newBounds extent)).
   206     ]
   204     ]
   254 ! !
   252 ! !
   255 
   253 
   256 !TranslatingWrapper class methodsFor:'documentation'!
   254 !TranslatingWrapper class methodsFor:'documentation'!
   257 
   255 
   258 version
   256 version
   259     ^ '$Header: /cvs/stx/stx/libview2/TranslatingWrapper.st,v 1.7 2003-08-18 12:13:42 cg Exp $'
   257     ^ '$Header: /cvs/stx/stx/libview2/TranslatingWrapper.st,v 1.8 2009-05-08 11:55:06 cg Exp $'
   260 ! !
   258 ! !