Skip to content

Commit ef949f2

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

File tree

1 file changed

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

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1549,12 +1549,16 @@ private void ensureBoldFontPresent(Font regularFont) {
15491549
}
15501550

15511551
private void paint(PaintEvent e) {
1552+
Point size = getSize();
1553+
if (size.x == 0 && size.y == 0) {
1554+
// avoids crash on image creation
1555+
return;
1556+
}
15521557
GC gc = e.gc;
15531558
gc.setFont(getFont());
15541559
ensureBoldFontPresent(getFont());
15551560
gc.setForeground(getForeground());
15561561
gc.setBackground(getBackground());
1557-
Point size = getSize();
15581562
repaint(gc, 0, 0, size.x, size.y);
15591563
}
15601564

0 commit comments

Comments
 (0)