Skip to content

Commit c72ec1c

Browse files
committed
FormText.paint(): don't pass (0,0) to Image on Linux
Fixes #3087
1 parent d2177cf commit c72ec1c

File tree

1 file changed

+5
-0
lines changed
  • bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.util.Hashtable;
2121

2222
import org.eclipse.core.runtime.ListenerList;
23+
import org.eclipse.jface.util.Util;
2324
import org.eclipse.swt.SWT;
2425
import org.eclipse.swt.SWTException;
2526
import org.eclipse.swt.accessibility.ACC;
@@ -1555,6 +1556,10 @@ private void paint(PaintEvent e) {
15551556
gc.setForeground(getForeground());
15561557
gc.setBackground(getBackground());
15571558
Point size = getSize();
1559+
if (size.x == 0 && size.y == 0 && Util.isLinux()) {
1560+
// On Linux, the size may be 0 and cause errors on Image creation.
1561+
size = new Point(1, 1);
1562+
}
15581563
repaint(gc, 0, 0, size.x, size.y);
15591564
}
15601565

0 commit comments

Comments
 (0)