Skip to content

Commit 6a3217b

Browse files
committed
[GEF] Remove workaround for connection line dash spacing bug on Windows 200% scale
- This is fixed - See eclipse-platform/eclipse.platform.swt#687
1 parent 6cd61ba commit 6a3217b

File tree

2 files changed

+2
-32
lines changed

2 files changed

+2
-32
lines changed

com.archimatetool.export.svg/src/com/archimatetool/export/svg/graphiti/GraphicsToGraphics2DAdaptor.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -1119,9 +1119,7 @@ public void setLineDash(int[] dash) {
11191119
public void setLineDash(float[] dash) {
11201120
currentState.lineAttributes.dash = dash;
11211121
setLineStyle(Graphics.LINE_CUSTOM);
1122-
// Don't apply the Windows 200% scaling workaround as it's not needed
1123-
// When exporting to SVG
1124-
swtGraphics.setLineDash(dash, false);
1122+
swtGraphics.setLineDash(dash);
11251123
}
11261124

11271125
/*

org.eclipse.draw2d/src/org/eclipse/draw2d/SWTGraphics.java

+1-29
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* <P>
4040
* WARNING: This class is not intended to be subclassed.
4141
*/
42-
@SuppressWarnings({"rawtypes", "unchecked", "restriction"})
42+
@SuppressWarnings({"rawtypes", "unchecked"})
4343
public class SWTGraphics extends Graphics {
4444

4545
private double scale = 1.0;
@@ -1286,21 +1286,7 @@ public void setInterpolation(int interpolation) {
12861286

12871287
@Override
12881288
public void setLineAttributes(LineAttributes lineAttributes) {
1289-
setLineAttributes(lineAttributes, true);
1290-
}
1291-
1292-
public void setLineAttributes(LineAttributes lineAttributes, boolean adjustForWindowsHiDPI) {
12931289
copyLineAttributes(currentState.lineAttributes, lineAttributes);
1294-
1295-
/*
1296-
* Hack to workaround bug on Windows 200% scaling where dashes are half size
1297-
* See https://github.com/eclipse-platform/eclipse.platform.swt/issues/687
1298-
*/
1299-
if(adjustForWindowsHiDPI && currentState.lineAttributes.dash != null && "win32".equals(SWT.getPlatform())) { //$NON-NLS-1$
1300-
for(int i = 0; i < currentState.lineAttributes.dash.length; i++) {
1301-
currentState.lineAttributes.dash[i] *= org.eclipse.swt.internal.DPIUtil.getDeviceZoom() / 100;
1302-
}
1303-
}
13041290
}
13051291

13061292
/**
@@ -1332,27 +1318,13 @@ public void setLineDash(int[] dashes) {
13321318
*/
13331319
@Override
13341320
public void setLineDash(float[] value) {
1335-
setLineDash(value, true);
1336-
}
1337-
1338-
public void setLineDash(float[] value, boolean adjustForWindowsHiDPI) {
13391321
if (value != null) {
13401322
// validate dash values
13411323
for (int i = 0; i < value.length; i++) {
13421324
if (value[i] <= 0) {
13431325
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
13441326
}
13451327
}
1346-
1347-
/*
1348-
* Hack to workaround bug on Windows 200% scaling where dashes are half size
1349-
* See https://github.com/eclipse-platform/eclipse.platform.swt/issues/687
1350-
*/
1351-
if(adjustForWindowsHiDPI && "win32".equals(SWT.getPlatform())) { //$NON-NLS-1$
1352-
for(int i = 0; i < value.length; i++) {
1353-
value[i] *= org.eclipse.swt.internal.DPIUtil.getDeviceZoom() / 100;
1354-
}
1355-
}
13561328

13571329
currentState.lineAttributes.dash = value.clone();
13581330
currentState.lineAttributes.style = SWT.LINE_CUSTOM;

0 commit comments

Comments
 (0)