summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2003-08-08 21:38:55 +0000
committerSilenio Quarti <silenio>2003-08-08 21:38:55 +0000
commit7b707211bdc588e23e1bb82a94bae0c99005f5c9 (patch)
tree560534c72119d240e1f7d62979e3b5362fbdd2ad
parent38e23d067c681e2f6d4eedd990f7acb4e0416bd6 (diff)
downloadeclipse.platform.swt-7b707211bdc588e23e1bb82a94bae0c99005f5c9.tar.gz
eclipse.platform.swt-7b707211bdc588e23e1bb82a94bae0c99005f5c9.tar.xz
eclipse.platform.swt-7b707211bdc588e23e1bb82a94bae0c99005f5c9.zip
move children when scrolling
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Canvas.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Canvas.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Canvas.java
index cc0a0adcc8..9fba269ffb 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Canvas.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Canvas.java
@@ -174,6 +174,18 @@ public void scroll (int destX, int destY, int x, int y, int width, int height, b
}
}
+ if (all) {
+ Control [] children = _getChildren ();
+ for (int i=0; i<children.length; i++) {
+ Control child = children [i];
+ Rectangle rect = child.getBounds ();
+ if (Math.min(x + width, rect.x + rect.width) > Math.max (x, rect.x) &&
+ Math.min(y + height, rect.y + rect.height) > Math.max (y, rect.y)) {
+ child.setLocation(rect.x + deltaX, rect.y + deltaY);
+ }
+ }
+ }
+
/* Show the caret */
if (isFocus) caret.setFocus ();
}