diff options
author | Silenio Quarti <silenio> | 2003-08-08 21:38:55 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2003-08-08 21:38:55 +0000 |
commit | 7b707211bdc588e23e1bb82a94bae0c99005f5c9 (patch) | |
tree | 560534c72119d240e1f7d62979e3b5362fbdd2ad | |
parent | 38e23d067c681e2f6d4eedd990f7acb4e0416bd6 (diff) | |
download | eclipse.platform.swt-7b707211bdc588e23e1bb82a94bae0c99005f5c9.tar.gz eclipse.platform.swt-7b707211bdc588e23e1bb82a94bae0c99005f5c9.tar.xz eclipse.platform.swt-7b707211bdc588e23e1bb82a94bae0c99005f5c9.zip |
move children when scrolling
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Canvas.java | 12 |
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 (); } |