Index: trunk/modules/awt/src/main/native/gl/windows/WinGDIPGraphics2D.cpp =================================================================== --- trunk/modules/awt/src/main/native/gl/windows/WinGDIPGraphics2D.cpp (revision 484668) +++ trunk/modules/awt/src/main/native/gl/windows/WinGDIPGraphics2D.cpp (working copy) @@ -406,6 +406,19 @@ if (dashLen > 1) { for (int i = 0; i < dashLen; i++) dash[i] /= lineWidth; + + // SetDashPattert is a Windows function and working incorrectly + // in case of odd number of elements in dash array. So in this + // case we just repeat the array sequence twice before passing + // to SetDashPattern function + if ((dashLen % 2) != 0) { + float *exDash = new float[dashLen * 2]; + for (int i = 0; i < dashLen; i++) + exDash[i] = dash[i]; + for (int i = 0; i < dashLen; i++) + exDash[dashLen + i] = dash[i]; + dash = exDash; + } res &= gi->pen->SetDashPattern(dash, dashLen); } else { REAL sdash[2] = {dash[0]/lineWidth, dash[0]/lineWidth};