UIPainterView.st
changeset 2386 4471bede7939
parent 2376 3bf786f18f5d
child 2387 050c6d4d427d
equal deleted inserted replaced
2385:b7dafe79bd7c 2386:4471bede7939
   472 
   472 
   473     specsToPaste do:[:eachSpec|
   473     specsToPaste do:[:eachSpec|
   474         |view newOrigin uiPainterAttributes thisAbsOrigin|
   474         |view newOrigin uiPainterAttributes thisAbsOrigin|
   475 
   475 
   476         uiPainterAttributes := eachSpec otherAttributeAt:#uiPainterAttributes.
   476         uiPainterAttributes := eachSpec otherAttributeAt:#uiPainterAttributes.
   477         eachSpec otherAttributeAt:#uiPainterAttributes put:nil.
   477         "/ eachSpec otherAttributeAt:#uiPainterAttributes put:nil.
   478 
   478 
   479         view := self addSpec:eachSpec builder:builder in:containerToPasteInto.
   479         view := self addSpec:eachSpec builder:builder in:containerToPasteInto.
   480 
   480 
   481         (keepPosition and:[ uiPainterAttributes notNil ]) ifTrue:[
   481         (keepPosition and:[ uiPainterAttributes notNil ]) ifTrue:[
   482             thisAbsOrigin := uiPainterAttributes at:#absOrigin.
   482             aPointOrNilOrKeep == #keep ifTrue:[
   483             newOrigin := device 
   483                 newOrigin := uiPainterAttributes at:#origin.
   484                                 translatePoint:thisAbsOrigin
   484             ] ifFalse:[
   485                                 fromView:self
   485                 thisAbsOrigin := uiPainterAttributes at:#absOrigin.
   486                                 toView:containerToPasteInto.
   486 
       
   487                 newOrigin := device 
       
   488                                     translatePoint:thisAbsOrigin
       
   489                                     fromView:self
       
   490                                     toView:containerToPasteInto.
       
   491             ].
   487         ] ifFalse:[
   492         ] ifFalse:[
   488             pastePoint isNil ifTrue:[ pastePoint := 0@0 ].
   493             pastePoint isNil ifTrue:[ pastePoint := 0@0 ].
   489             newOrigin := device 
   494             newOrigin := device 
   490                                 translatePoint:pastePoint
   495                                 translatePoint:pastePoint
   491                                 fromView:self
   496                                 fromView:self
   499         newOrigin notNil ifTrue:[
   504         newOrigin notNil ifTrue:[
   500             self moveObject:view to:newOrigin.
   505             self moveObject:view to:newOrigin.
   501         ].
   506         ].
   502         view realize.
   507         view realize.
   503         newSel add:view.
   508         newSel add:view.
       
   509 
   504     ].
   510     ].
   505 
   511 
   506     self withinTransaction:#paste objects:newSel do:[
   512     self withinTransaction:#paste objects:newSel do:[
   507         undoHistory addUndoSelector:#undoCreate:
   513         undoHistory addUndoSelector:#undoCreate:
   508                            withArgs:(newSel collect:[:v|(self propertyOfView:v) identifier]).
   514                            withArgs:(newSel collect:[:v|(self propertyOfView:v) identifier]).