Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: swt-initiative31/prototype-skija
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 897d0829fe920007dd9ddd61659cc1255c74351f
Choose a base ref
..
head repository: swt-initiative31/prototype-skija
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: aca08a11fc056a1159dc131a48218579db5606c5
Choose a head ref
Original file line number Diff line number Diff line change
@@ -61,8 +61,10 @@ public static void drawWithGC(Control control, GC originalGC, Consumer<GC> drawO
}
}

boolean usingTemporaryGC = false;
if (originalGC == null) {
originalGC = new GC(control);
usingTemporaryGC = true;
}
originalGC.setFont(control.getFont());
originalGC.setForeground(control.getForeground());
@@ -77,6 +79,9 @@ public static void drawWithGC(Control control, GC originalGC, Consumer<GC> drawO
gc.commit();
} finally {
gc.dispose();
if (usingTemporaryGC) {
originalGC.dispose();
}
}
}

Original file line number Diff line number Diff line change
@@ -538,7 +538,10 @@ public void drawText(String text, int x, int y, int flags) {
return;
}
TextBlob textBlob = buildTextBlob(text);
if (textBlob != null && (flags & (SWT.TRANSPARENT | SWT.DRAW_TRANSPARENT)) == 0) {
if (textBlob == null) {
return;
}
if ((flags & (SWT.TRANSPARENT | SWT.DRAW_TRANSPARENT)) == 0) {
int textWidth = (int) textBlob.getBounds().getWidth();
int fontHeight = (int) font.getMetrics().getHeight();
fillRectangle(x, y, textWidth, fontHeight);