Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Singer2020-08-24 11:08:23 +0000
committerSravan Kumar Lakkimsetti2020-09-30 05:31:49 +0000
commit962bc418d30aec9515bcaa34cdcc0b659009c8a2 (patch)
treec2752915440b6e160eaa0bd19491425efe1cd1a3
parentd41be77a523c046dd3fc3ade21a80e67ef48d70c (diff)
downloadeclipse.platform.swt-962bc418d30aec9515bcaa34cdcc0b659009c8a2.tar.gz
eclipse.platform.swt-962bc418d30aec9515bcaa34cdcc0b659009c8a2.tar.xz
eclipse.platform.swt-962bc418d30aec9515bcaa34cdcc0b659009c8a2.zip
Bug 539693 - [Cocoa][10.14] Unified toolbar: returns excessively large size
Change-Id: I6b9eacc75291e8b6aa0f968d02af3e86cefdf65b Signed-off-by: Thomas Singer <ts-swt@syntevo.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java
index 6b10254e5b..3fe7c57979 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java
@@ -586,6 +586,14 @@ int [] layoutUnified (int width, int height, boolean resize) {
for (int i=0; i<itemCount; i++) {
Point size = sizes [i] = items [i].computeSize ();
containerRects [i] = new NSView(itemViewers.objectAtIndex(i)).frame();
+ // workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=539693
+ if (containerRects [i].width < 0 || containerRects [i].width > 100000) {
+ containerRects [i].x = 0;
+ containerRects [i].y = 0;
+ containerRects [i].width = 0;
+ containerRects [i].height = 0;
+ }
+
if (i == 0) x = (int) containerRects[0].x;
itemHeight = Math.max (itemHeight, size.y);
}

Back to the top