diff options
4 files changed, 8 insertions, 8 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java index 332603fa18..54bd81aa3a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/graphics/GC.java @@ -2975,7 +2975,7 @@ public void setLineDash(int[] dashes) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); int[] lineDashes = data.lineDashes; if (dashes != null && dashes.length > 0) { - boolean changed = lineDashes == null || lineDashes.length != dashes.length; + boolean changed = data.lineStyle != SWT.LINE_CUSTOM || lineDashes == null || lineDashes.length != dashes.length; for (int i = 0; i < dashes.length; i++) { int dash = dashes[i]; if (dash <= 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT); @@ -2986,7 +2986,7 @@ public void setLineDash(int[] dashes) { System.arraycopy(dashes, 0, data.lineDashes, 0, dashes.length); data.lineStyle = SWT.LINE_CUSTOM; } else { - if (lineDashes == null || lineDashes.length == 0) return; + if (data.lineStyle == SWT.LINE_SOLID && (lineDashes == null || lineDashes.length == 0)) return; data.lineDashes = null; data.lineStyle = SWT.LINE_SOLID; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java index 3e799b4903..01ce04e145 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java @@ -3212,7 +3212,7 @@ public void setLineDash(int[] dashes) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); int[] lineDashes = data.lineDashes; if (dashes != null && dashes.length > 0) { - boolean changed = lineDashes == null || lineDashes.length != dashes.length; + boolean changed = data.lineStyle != SWT.LINE_CUSTOM || lineDashes == null || lineDashes.length != dashes.length; for (int i = 0; i < dashes.length; i++) { int dash = dashes[i]; if (dash <= 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT); @@ -3223,7 +3223,7 @@ public void setLineDash(int[] dashes) { System.arraycopy(dashes, 0, data.lineDashes, 0, dashes.length); data.lineStyle = SWT.LINE_CUSTOM; } else { - if (lineDashes == null || lineDashes.length == 0) return; + if (data.lineStyle == SWT.LINE_SOLID && (lineDashes == null || lineDashes.length == 0)) return; data.lineDashes = null; data.lineStyle = SWT.LINE_SOLID; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java index 724bfa5cbd..2e556985ee 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java @@ -3843,7 +3843,7 @@ public void setLineDash(int[] dashes) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); int[] lineDashes = data.lineDashes; if (dashes != null && dashes.length > 0) { - boolean changed = lineDashes == null || lineDashes.length != dashes.length; + boolean changed = data.lineStyle != SWT.LINE_CUSTOM || lineDashes == null || lineDashes.length != dashes.length; for (int i = 0; i < dashes.length; i++) { int dash = dashes[i]; if (dash <= 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT); @@ -3854,7 +3854,7 @@ public void setLineDash(int[] dashes) { System.arraycopy(dashes, 0, data.lineDashes, 0, dashes.length); data.lineStyle = SWT.LINE_CUSTOM; } else { - if (lineDashes == null || lineDashes.length == 0) return; + if (data.lineStyle == SWT.LINE_SOLID && (lineDashes == null || lineDashes.length == 0)) return; data.lineDashes = null; data.lineStyle = SWT.LINE_SOLID; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java index 1c4cbd790d..adcafd6196 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java @@ -3855,7 +3855,7 @@ public void setLineDash(int[] dashes) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); int[] lineDashes = data.lineDashes; if (dashes != null && dashes.length > 0) { - boolean changed = lineDashes == null || lineDashes.length != dashes.length; + boolean changed = data.lineStyle != SWT.LINE_CUSTOM || lineDashes == null || lineDashes.length != dashes.length; for (int i = 0; i < dashes.length; i++) { int dash = dashes[i]; if (dash <= 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT); @@ -3866,7 +3866,7 @@ public void setLineDash(int[] dashes) { System.arraycopy(dashes, 0, data.lineDashes, 0, dashes.length); data.lineStyle = SWT.LINE_CUSTOM; } else { - if (lineDashes == null || lineDashes.length == 0) return; + if (data.lineStyle == SWT.LINE_SOLID && (lineDashes == null || lineDashes.length == 0)) return; data.lineDashes = null; data.lineStyle = SWT.LINE_SOLID; } |