Skip to content

Commit 4e4fdcb

Browse files
committed
Revert workaround for unexpected text wrapping in ExpandableComposite
A workaround for unexpected text wrapping in ExpandableComposite had been introduced to deal with imprecise size calculation of controls for zooms like 125% and 175%. With recent changes to SWT, the size calculation for controls has been improved such that they always allocate sufficient space to fit their contents in. That makes the workaround in ExpandableComposite obsolete. This change thus removes the obsolete workaround.
1 parent 2d4334f commit 4e4fdcb

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/ExpandableComposite.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
import org.eclipse.core.runtime.Assert;
2424
import org.eclipse.core.runtime.ListenerList;
25-
import org.eclipse.core.runtime.Platform.OS;
2625
import org.eclipse.swt.SWT;
2726
import org.eclipse.swt.events.FocusEvent;
2827
import org.eclipse.swt.events.FocusListener;
@@ -289,13 +288,7 @@ protected void layout(Composite parent, boolean changed) {
289288
Point labelDefault = this.textLabelCache.computeSize(SWT.DEFAULT, SWT.DEFAULT);
290289

291290
int tcWidthBeforeSplit = Math.min(width, tcDefault.x);
292-
293-
int additionalLabelWidthPadding = 0;
294-
if (OS.isWindows()) {
295-
/* compensate rounding issue in windows */
296-
additionalLabelWidthPadding = 1;
297-
}
298-
int labelWidthBeforeSplit = Math.min(width, labelDefault.x + additionalLabelWidthPadding);
291+
int labelWidthBeforeSplit = Math.min(width, labelDefault.x);
299292

300293
int tcWidthAfterSplit = tcWidthBeforeSplit;
301294
int labelWidthAfterSplit = labelWidthBeforeSplit;

0 commit comments

Comments
 (0)