bugfix - copy & paste with layout
authorca
Wed, 06 Aug 2008 17:23:05 +0200
changeset 2386 4471bede7939
parent 2385 b7dafe79bd7c
child 2387 050c6d4d427d
bugfix - copy & paste with layout
UIPainterView.st
--- a/UIPainterView.st	Tue Aug 05 15:59:25 2008 +0200
+++ b/UIPainterView.st	Wed Aug 06 17:23:05 2008 +0200
@@ -474,16 +474,21 @@
         |view newOrigin uiPainterAttributes thisAbsOrigin|
 
         uiPainterAttributes := eachSpec otherAttributeAt:#uiPainterAttributes.
-        eachSpec otherAttributeAt:#uiPainterAttributes put:nil.
+        "/ eachSpec otherAttributeAt:#uiPainterAttributes put:nil.
 
         view := self addSpec:eachSpec builder:builder in:containerToPasteInto.
 
         (keepPosition and:[ uiPainterAttributes notNil ]) ifTrue:[
-            thisAbsOrigin := uiPainterAttributes at:#absOrigin.
-            newOrigin := device 
-                                translatePoint:thisAbsOrigin
-                                fromView:self
-                                toView:containerToPasteInto.
+            aPointOrNilOrKeep == #keep ifTrue:[
+                newOrigin := uiPainterAttributes at:#origin.
+            ] ifFalse:[
+                thisAbsOrigin := uiPainterAttributes at:#absOrigin.
+
+                newOrigin := device 
+                                    translatePoint:thisAbsOrigin
+                                    fromView:self
+                                    toView:containerToPasteInto.
+            ].
         ] ifFalse:[
             pastePoint isNil ifTrue:[ pastePoint := 0@0 ].
             newOrigin := device 
@@ -501,6 +506,7 @@
         ].
         view realize.
         newSel add:view.
+
     ].
 
     self withinTransaction:#paste objects:newSel do:[