targetPoitn was computed wrong for textViews (scrollOffset)
authorClaus Gittinger <cg@exept.de>
Mon, 05 May 2008 16:04:09 +0200
changeset 2444 3d985b31faf2
parent 2443 1043b37a4a5a
child 2445 5ace64945a9b
targetPoitn was computed wrong for textViews (scrollOffset)
DropContext.st
--- a/DropContext.st	Fri Apr 25 16:19:58 2008 +0200
+++ b/DropContext.st	Mon May 05 16:04:09 2008 +0200
@@ -119,17 +119,21 @@
 !
 
 targetPoint
-    "returns the relative point on the target widget"
+    "returns the relative point on the target widget (in logical coordinates)"
 
-    |trn pnt dev|
+    |trn org pnt dev|
 
     dev := sourceWidget device.
     pnt := dev translatePoint:rootPoint from:(dev rootWindowId) to:targetId.
 
     targetWidget notNil ifTrue:[
         (trn := targetWidget transformation) notNil ifTrue:[
-            ^ trn applyInverseTo:pnt
-        ]
+            ^ trn applyInverseTo:pnt.
+        ].
+
+        (org := targetWidget viewOrigin) notNil ifTrue:[
+            ^ pnt + org.
+        ].
     ].
     ^ pnt
 !
@@ -295,5 +299,5 @@
 !DropContext class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/DropContext.st,v 1.12 2006-10-13 16:24:04 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/DropContext.st,v 1.13 2008-05-05 14:04:09 cg Exp $'
 ! !