harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r519284 - /harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java
Date Sat, 17 Mar 2007 10:41:03 GMT
Author: apetrenko
Date: Sat Mar 17 03:41:02 2007
New Revision: 519284

URL: http://svn.apache.org/viewvc?view=rev&rev=519284
Log:
Patch for HARMONY-2050 "[classlib][awt] Incorrect drawing of dashed line"

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java?view=diff&rev=519284&r1=519283&r2=519284
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java
Sat Mar 17 03:41:02 2007
@@ -304,6 +304,13 @@
 
         BasicStroke bs = (BasicStroke)stroke;
         float []dash = bs.getDashArray();
+        if (dash != null && dash.length % 2 == 1) {
+            // If dash len is odd then we need to double the array           
+            float []newDash = new float[dash.length*2];
+            System.arraycopy(dash, 0, newDash, 0, dash.length);
+            System.arraycopy(dash, 0, newDash, dash.length, dash.length);
+            dash = newDash;
+        }
         setPen(gi, bs.getLineWidth(), bs.getEndCap(), bs.getLineJoin(), bs.getMiterLimit(),
                 dash, (dash != null)?dash.length:0, bs.getDashPhase());
     }



Mime
View raw message