*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Wed, 20 Aug 2008 19:54:33 +0200
changeset 2398 bdefc2be920a
parent 2397 07ab2bdac066
child 2399 1ae184ce9595
*** empty log message ***
UIObjectView.st
--- a/UIObjectView.st	Fri Aug 08 16:43:46 2008 +0200
+++ b/UIObjectView.st	Wed Aug 20 19:54:33 2008 +0200
@@ -1675,9 +1675,27 @@
 pasteExtent
     "paste the copied extent to all objects in the selection"
 
+    |heightToPaste widthToPaste|
+
     CopiedExtent notNil ifTrue:[
-        self transaction:#pasteExtent dimensionDo:[:v|
-            self resize:v corner:(v computeOrigin + CopiedExtent)
+        widthToPaste := CopiedExtent x.
+        heightToPaste := CopiedExtent y.
+    ] ifFalse:[
+        CopiedLayout notNil ifTrue:[
+            CopiedLayout leftFraction = CopiedLayout rightFraction ifTrue:[
+                CopiedLayout topFraction = CopiedLayout bottomFraction ifTrue:[
+                    widthToPaste := (CopiedLayout rightOffset - CopiedLayout leftOffset). 
+                    heightToPaste := (CopiedLayout bottomOffset - CopiedLayout topOffset). 
+                ]
+            ]
+        ].
+    ].
+
+    widthToPaste notNil ifTrue:[
+        heightToPaste notNil ifTrue:[
+            self transaction:#pasteExtent dimensionDo:[:v|
+                self resize:v corner:(v computeOrigin + (widthToPaste@heightToPaste))
+            ]    
         ]    
     ]    
 !
@@ -1685,11 +1703,43 @@
 pasteHeight
     "paste the copied extent's height to all objects in the selection"
 
+    |heightToPaste|
+
     CopiedExtent notNil ifTrue:[
+        heightToPaste := CopiedExtent y.
+    ] ifFalse:[
+        CopiedLayout notNil ifTrue:[
+            CopiedLayout topFraction = CopiedLayout bottomFraction ifTrue:[
+                heightToPaste := (CopiedLayout bottomOffset - CopiedLayout topOffset) 
+            ]
+        ].
+    ].
+
+    heightToPaste notNil ifTrue:[
         self transaction:#pasteHeight dimensionDo:[:v|
-            self resize:v bottom:(v computeOrigin + CopiedExtent y)
-        ]    
-    ]    
+            self resize:v bottom:(v computeOrigin + heightToPaste)
+        ].
+        ^ self.
+    ].    
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 !
 
 pasteLayout
@@ -1705,9 +1755,21 @@
 pasteWidth
     "paste the copied extent's width to all objects in the selection"
 
+    |widthToPaste|
+
     CopiedExtent notNil ifTrue:[
+        widthToPaste := CopiedExtent x.
+    ] ifFalse:[
+        CopiedLayout notNil ifTrue:[
+            CopiedLayout leftFraction = CopiedLayout rightFraction ifTrue:[
+                widthToPaste := (CopiedLayout rightOffset - CopiedLayout leftOffset) 
+            ]
+        ].
+    ].
+
+    widthToPaste notNil ifTrue:[
         self transaction:#pasteWidth dimensionDo:[:v|
-            self resize:v right:(v computeOrigin + CopiedExtent x)
+            self resize:v right:(v computeOrigin + widthToPaste)
         ]    
     ]    
 !