Skip to content

Commit

Permalink
Fix wrong line width on Windows hi-dpi
Browse files Browse the repository at this point in the history
- On Windows hi-dpi calling GC#setLineAttributes will mean that lineattributes.width is increased by calling DPIUtil.autoScaleUp so we clone lineAttributes

- See #248
  • Loading branch information
Phillipus authored and azoitl committed Aug 23, 2023
1 parent ff0b9c3 commit 03fa73c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion org.eclipse.draw2d/src/org/eclipse/draw2d/SWTGraphics.java
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ protected final void checkPaint() {
LineAttributes lineAttributes = currentState.lineAttributes;
if (!appliedState.lineAttributes.equals(lineAttributes)) {
if (getAdvanced()) {
gc.setLineAttributes(lineAttributes);
gc.setLineAttributes(clone(lineAttributes)); // Clone lineAttributes because on Windows hi-dpi the line width may be increased
} else {
gc.setLineWidth((int) lineAttributes.width);
gc.setLineCap(lineAttributes.cap);
Expand Down

0 comments on commit 03fa73c

Please sign in to comment.