diff --git a/binaries/org.eclipse.swt.cocoa.macosx.aarch64/META-INF/MANIFEST.MF b/binaries/org.eclipse.swt.cocoa.macosx.aarch64/META-INF/MANIFEST.MF index ac3a606dae0..126ecc19ba8 100644 --- a/binaries/org.eclipse.swt.cocoa.macosx.aarch64/META-INF/MANIFEST.MF +++ b/binaries/org.eclipse.swt.cocoa.macosx.aarch64/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Fragment-Host: org.eclipse.swt;bundle-version="[3.128.0,4.0.0)" Bundle-Name: %fragmentName Bundle-Vendor: %providerName Bundle-SymbolicName: org.eclipse.swt.cocoa.macosx.aarch64; singleton:=true -Bundle-Version: 3.131.100.qualifier +Bundle-Version: 3.132.0.qualifier Bundle-ManifestVersion: 2 Bundle-Localization: fragment Export-Package: diff --git a/binaries/org.eclipse.swt.cocoa.macosx.x86_64/META-INF/MANIFEST.MF b/binaries/org.eclipse.swt.cocoa.macosx.x86_64/META-INF/MANIFEST.MF index cd516b318e0..799baef7c67 100644 --- a/binaries/org.eclipse.swt.cocoa.macosx.x86_64/META-INF/MANIFEST.MF +++ b/binaries/org.eclipse.swt.cocoa.macosx.x86_64/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Fragment-Host: org.eclipse.swt;bundle-version="[3.128.0,4.0.0)" Bundle-Name: %fragmentName Bundle-Vendor: %providerName Bundle-SymbolicName: org.eclipse.swt.cocoa.macosx.x86_64; singleton:=true -Bundle-Version: 3.131.100.qualifier +Bundle-Version: 3.132.0.qualifier Bundle-ManifestVersion: 2 Bundle-Localization: fragment Export-Package: diff --git a/binaries/org.eclipse.swt.gtk.linux.aarch64/META-INF/MANIFEST.MF b/binaries/org.eclipse.swt.gtk.linux.aarch64/META-INF/MANIFEST.MF index 77b5072882b..e2a8a8d3661 100644 --- a/binaries/org.eclipse.swt.gtk.linux.aarch64/META-INF/MANIFEST.MF +++ b/binaries/org.eclipse.swt.gtk.linux.aarch64/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Fragment-Host: org.eclipse.swt;bundle-version="[3.128.0,4.0.0)" Bundle-Name: %fragmentName Bundle-Vendor: %providerName Bundle-SymbolicName: org.eclipse.swt.gtk.linux.aarch64; singleton:=true -Bundle-Version: 3.131.100.qualifier +Bundle-Version: 3.132.0.qualifier Bundle-ManifestVersion: 2 Bundle-Localization: fragment Export-Package: diff --git a/binaries/org.eclipse.swt.gtk.linux.loongarch64/META-INF/MANIFEST.MF b/binaries/org.eclipse.swt.gtk.linux.loongarch64/META-INF/MANIFEST.MF index 681fcdc9a62..db1efee8c1c 100644 --- a/binaries/org.eclipse.swt.gtk.linux.loongarch64/META-INF/MANIFEST.MF +++ b/binaries/org.eclipse.swt.gtk.linux.loongarch64/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Fragment-Host: org.eclipse.swt;bundle-version="[3.128.0,4.0.0)" Bundle-Name: %fragmentName Bundle-Vendor: %providerName Bundle-SymbolicName: org.eclipse.swt.gtk.linux.loongarch64; singleton:=true -Bundle-Version: 3.131.0.qualifier +Bundle-Version: 3.132.0.qualifier Bundle-ManifestVersion: 2 Bundle-Localization: fragment Export-Package: diff --git a/binaries/org.eclipse.swt.gtk.linux.ppc64le/META-INF/MANIFEST.MF b/binaries/org.eclipse.swt.gtk.linux.ppc64le/META-INF/MANIFEST.MF index 6d14bd58674..f6015be594d 100644 --- a/binaries/org.eclipse.swt.gtk.linux.ppc64le/META-INF/MANIFEST.MF +++ b/binaries/org.eclipse.swt.gtk.linux.ppc64le/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Fragment-Host: org.eclipse.swt;bundle-version="[3.128.0,4.0.0)" Bundle-Name: %fragmentName Bundle-Vendor: %providerName Bundle-SymbolicName: org.eclipse.swt.gtk.linux.ppc64le;singleton:=true -Bundle-Version: 3.131.100.qualifier +Bundle-Version: 3.132.0.qualifier Bundle-ManifestVersion: 2 Bundle-Localization: fragment Export-Package: diff --git a/binaries/org.eclipse.swt.gtk.linux.riscv64/META-INF/MANIFEST.MF b/binaries/org.eclipse.swt.gtk.linux.riscv64/META-INF/MANIFEST.MF index 7fd71e115d8..76d0b4ea316 100644 --- a/binaries/org.eclipse.swt.gtk.linux.riscv64/META-INF/MANIFEST.MF +++ b/binaries/org.eclipse.swt.gtk.linux.riscv64/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Fragment-Host: org.eclipse.swt;bundle-version="[3.128.0,4.0.0)" Bundle-Name: %fragmentName Bundle-Vendor: %providerName Bundle-SymbolicName: org.eclipse.swt.gtk.linux.riscv64; singleton:=true -Bundle-Version: 3.131.100.qualifier +Bundle-Version: 3.132.0.qualifier Bundle-ManifestVersion: 2 Bundle-Localization: fragment Export-Package: diff --git a/binaries/org.eclipse.swt.gtk.linux.x86_64/META-INF/MANIFEST.MF b/binaries/org.eclipse.swt.gtk.linux.x86_64/META-INF/MANIFEST.MF index afe6592fba2..5ce90b73997 100644 --- a/binaries/org.eclipse.swt.gtk.linux.x86_64/META-INF/MANIFEST.MF +++ b/binaries/org.eclipse.swt.gtk.linux.x86_64/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Fragment-Host: org.eclipse.swt;bundle-version="[3.128.0,4.0.0)" Bundle-Name: %fragmentName Bundle-Vendor: %providerName Bundle-SymbolicName: org.eclipse.swt.gtk.linux.x86_64; singleton:=true -Bundle-Version: 3.131.100.qualifier +Bundle-Version: 3.132.0.qualifier Bundle-ManifestVersion: 2 Bundle-Localization: fragment Export-Package: diff --git a/binaries/org.eclipse.swt.win32.win32.aarch64/META-INF/MANIFEST.MF b/binaries/org.eclipse.swt.win32.win32.aarch64/META-INF/MANIFEST.MF index b6dc89e7117..3fd6e010835 100644 --- a/binaries/org.eclipse.swt.win32.win32.aarch64/META-INF/MANIFEST.MF +++ b/binaries/org.eclipse.swt.win32.win32.aarch64/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Fragment-Host: org.eclipse.swt;bundle-version="[3.128.0,4.0.0)" Bundle-Name: %fragmentName Bundle-Vendor: %providerName Bundle-SymbolicName: org.eclipse.swt.win32.win32.aarch64; singleton:=true -Bundle-Version: 3.131.100.qualifier +Bundle-Version: 3.132.0.qualifier Bundle-ManifestVersion: 2 Bundle-Localization: fragment Export-Package: diff --git a/binaries/org.eclipse.swt.win32.win32.x86_64/META-INF/MANIFEST.MF b/binaries/org.eclipse.swt.win32.win32.x86_64/META-INF/MANIFEST.MF index 873ca47cd08..84f618f2b6a 100644 --- a/binaries/org.eclipse.swt.win32.win32.x86_64/META-INF/MANIFEST.MF +++ b/binaries/org.eclipse.swt.win32.win32.x86_64/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Fragment-Host: org.eclipse.swt;bundle-version="[3.128.0,4.0.0)" Bundle-Name: %fragmentName Bundle-Vendor: %providerName Bundle-SymbolicName: org.eclipse.swt.win32.win32.x86_64; singleton:=true -Bundle-Version: 3.131.100.qualifier +Bundle-Version: 3.132.0.qualifier Bundle-ManifestVersion: 2 Bundle-Localization: fragment Export-Package: diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/Point.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/Point.java index b1a026ca92c..9bb910b7197 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/Point.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/Point.java @@ -158,6 +158,13 @@ public void setY(float y) { this.y = Math.round(y); this.residualY = y - this.y; } + + public static Point.OfFloat from(Point point) { + if (point instanceof Point.OfFloat pointOfFloat) { + return new Point.OfFloat(pointOfFloat.getX(), pointOfFloat.getY()); + } + return new Point.OfFloat(point.x, point.y); + } } /** diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/Rectangle.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/Rectangle.java index 935f61e9e6e..02f58c6799e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/Rectangle.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/Rectangle.java @@ -459,6 +459,13 @@ public void setHeight(float height) { this.residualHeight = height - this.height; } + public static Rectangle.OfFloat from(Rectangle rectangle) { + if (rectangle instanceof Rectangle.OfFloat rectangleOfFloat) { + return new Rectangle.OfFloat(rectangleOfFloat.getX(), rectangleOfFloat.getY(), rectangleOfFloat.getWidth(), rectangleOfFloat.getHeight()); + } + return new Rectangle.OfFloat(rectangle.x, rectangle.y, rectangle.width, rectangle.height); + } + } /** diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/GridData.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/GridData.java index 3ecff268ff1..12c271ecde0 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/GridData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/GridData.java @@ -398,9 +398,9 @@ public final class GridData { */ public static final int FILL_BOTH = FILL_VERTICAL | FILL_HORIZONTAL; - int cacheWidth = -1, cacheHeight = -1; - int defaultWhint, defaultHhint, defaultWidth = -1, defaultHeight = -1; - int currentWhint, currentHhint, currentWidth = -1, currentHeight = -1; + float cacheWidth = -1, cacheHeight = -1; + int defaultWhint, defaultHhint, currentWhint, currentHhint; + float defaultWidth = -1, defaultHeight = -1, currentWidth = -1, currentHeight = -1; /** * Constructs a new instance of GridData using @@ -493,19 +493,20 @@ void computeSize (Control control, int wHint, int hHint, boolean flushCache) { Point size = control.computeSize (wHint, hHint, flushCache); defaultWhint = wHint; defaultHhint = hHint; - defaultWidth = size.x; - defaultHeight = size.y; + Point.OfFloat defaultSize = Point.OfFloat.from(size); + defaultWidth = defaultSize.getX(); + defaultHeight = defaultSize.getY(); } cacheWidth = defaultWidth; cacheHeight = defaultHeight; return; } if (currentWidth == -1 || currentHeight == -1 || wHint != currentWhint || hHint != currentHhint) { - Point size = control.computeSize (wHint, hHint, flushCache); + Point.OfFloat size = Point.OfFloat.from(control.computeSize (wHint, hHint, flushCache)); currentWhint = wHint; currentHhint = hHint; - currentWidth = size.x; - currentHeight = size.y; + currentWidth = size.getX(); + currentHeight = size.getY(); } cacheWidth = currentWidth; cacheHeight = currentHeight; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/GridLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/GridLayout.java index d0bb2c6f422..5b580890be9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/GridLayout.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/layout/GridLayout.java @@ -292,8 +292,8 @@ Point layout (Composite composite, boolean move, int x, int y, int width, int he /* Column widths */ int availableWidth = width - horizontalSpacing * (columnCount - 1) - (marginLeft + marginWidth * 2 + marginRight); int expandCount = 0; - int [] widths = new int [columnCount]; - int [] minWidths = new int [columnCount]; + float [] widths = new float [columnCount]; + float [] minWidths = new float [columnCount]; boolean [] expandColumn = new boolean [columnCount]; for (int j=0; j 0) { if (makeColumnsEqualWidth) { - int equalWidth = (w + spanWidth) / hSpan; - int remainder = (w + spanWidth) % hSpan, last = -1; + float equalWidth = (w + spanWidth) / hSpan; for (int k = 0; k < hSpan; k++) { - widths [last=j-k] = Math.max (equalWidth, widths [j-k]); + widths [j-k] = Math.max (equalWidth, widths [j-k]); } - if (last > -1) widths [last] += remainder; } else { if (spanExpandCount == 0) { widths [j] += w; } else { - int delta = w / spanExpandCount; - int remainder = w % spanExpandCount, last = -1; + float delta = w / spanExpandCount; for (int k = 0; k < hSpan; k++) { if (expandColumn [j-k]) { - widths [last=j-k] += delta; + widths [j-k] += delta; } } - if (last > -1) widths [last] += remainder; } } } @@ -361,14 +357,12 @@ Point layout (Composite composite, boolean move, int x, int y, int width, int he if (spanExpandCount == 0) { minWidths [j] += w; } else { - int delta = w / spanExpandCount; - int remainder = w % spanExpandCount, last = -1; + float delta = w / spanExpandCount; for (int k = 0; k < hSpan; k++) { if (expandColumn [j-k]) { - minWidths [last=j-k] += delta; + minWidths [j-k] += delta; } } - if (last > -1) minWidths [last] += remainder; } } } @@ -377,8 +371,8 @@ Point layout (Composite composite, boolean move, int x, int y, int width, int he } } if (makeColumnsEqualWidth) { - int minColumnWidth = 0; - int columnWidth = 0; + float minColumnWidth = 0; + float columnWidth = 0; for (int i=0; i 0) { if (spanExpandCount == 0) { widths [j] += w; } else { - int delta2 = w / spanExpandCount; - int remainder2 = w % spanExpandCount, last2 = -1; + float delta2 = w / spanExpandCount; for (int k = 0; k < hSpan; k++) { if (expandColumn [j-k]) { - widths [last2=j-k] += delta2; + widths [j-k] += delta2; } } - if (last2 > -1) widths [last2] += remainder2; } } } @@ -499,8 +491,8 @@ Point layout (Composite composite, boolean move, int x, int y, int width, int he /* Row heights */ int availableHeight = height - verticalSpacing * (rowCount - 1) - (marginTop + marginHeight * 2 + marginBottom); expandCount = 0; - int [] heights = new int [rowCount]; - int [] minHeights = new int [rowCount]; + float [] heights = new float [rowCount]; + float [] minHeights = new float [rowCount]; boolean [] expandRow = new boolean [rowCount]; for (int i=0; i 0) { if (spanExpandCount == 0) { heights [i] += h; } else { - int delta = h / spanExpandCount; - int remainder = h % spanExpandCount, last = -1; + float delta = h / spanExpandCount; for (int k = 0; k < vSpan; k++) { if (expandRow [i-k]) { - heights [last=i-k] += delta; + heights [i-k] += delta; } } - if (last > -1) heights [last] += remainder; } } if (!data.grabExcessVerticalSpace || data.minimumHeight != 0) { @@ -559,14 +549,12 @@ Point layout (Composite composite, boolean move, int x, int y, int width, int he if (spanExpandCount == 0) { minHeights [i] += h; } else { - int delta = h / spanExpandCount; - int remainder = h % spanExpandCount, last = -1; + float delta = h / spanExpandCount; for (int k = 0; k < vSpan; k++) { if (expandRow [i-k]) { - minHeights [last=i-k] += delta; + minHeights [i-k] += delta; } } - if (last > -1) minHeights [last] += remainder; } } } @@ -609,20 +597,18 @@ Point layout (Composite composite, boolean move, int x, int y, int width, int he spanHeight += heights [i-k]; if (expandRow [i-k]) spanExpandCount++; } - int h = !data.grabExcessVerticalSpace || data.minimumHeight == SWT.DEFAULT ? data.cacheHeight : data.minimumHeight; + float h = !data.grabExcessVerticalSpace || data.minimumHeight == SWT.DEFAULT ? data.cacheHeight : data.minimumHeight; h += data.verticalIndent - spanHeight - (vSpan - 1) * verticalSpacing; if (h > 0) { if (spanExpandCount == 0) { heights [i] += h; } else { - int delta2 = h / spanExpandCount; - int remainder2 = h % spanExpandCount, last2 = -1; + float delta2 = h / spanExpandCount; for (int k = 0; k < vSpan; k++) { if (expandRow [i-k]) { - heights [last2=i-k] += delta2; + heights [i-k] += delta2; } } - if (last2 > -1) heights [last2] += remainder2; } } } @@ -651,7 +637,7 @@ Point layout (Composite composite, boolean move, int x, int y, int width, int he if (data != null) { int hSpan = Math.max (1, Math.min (data.horizontalSpan, columnCount)); int vSpan = Math.max (1, data.verticalSpan); - int cellWidth = 0, cellHeight = 0; + float cellWidth = 0, cellHeight = 0; for (int k=0; k