=== modified file 'src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.canvas_renderer_webgl.js'
--- src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.canvas_renderer_webgl.js	2020-11-16 09:55:48 +0000
+++ src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.canvas_renderer_webgl.js	2020-11-16 13:26:49 +0000
@@ -2073,7 +2073,7 @@
       
       renderer.beginStroke();
       this.drawLineSegment(x, y, x + width - 1, y, renderer);
-      this.drawLineSegment(x + width - 1, y + 1, x + width - 1, y + height - 1, renderer);
+      this.drawLineSegment(x + width - 1, y, x + width - 1, y + height - 1, renderer);
       this.drawLineSegment(x + width - 1, y + height - 1, x, y + height - 1, renderer);
       this.drawLineSegment(x, y + height - 1, x, y, renderer);// close the path      
    }

=== modified file 'src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.strokes.webgl.js'
--- src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.strokes.webgl.js	2020-11-15 23:09:44 +0000
+++ src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.strokes.webgl.js	2020-11-16 13:11:13 +0000
@@ -503,7 +503,7 @@
             
             if (dashOn)
             {
-               canvasRenderer.drawImage(x - hw - canvasRenderer.origin.x, y - hw - canvasRenderer.origin.y, width, width, pixelData);
+               canvasRenderer.drawImage(x - hw, y - hw, width, width, pixelData, true, false);
             }
             // vertical line: increase Y-coordinate
             if (dx == 0)
@@ -562,7 +562,7 @@
          rest -= 1;
          if (dashOn)
          {
-            canvasRenderer.drawImage(x - hw - canvasRenderer.origin.x, y - hw - canvasRenderer.origin.y, width, width, pixelData);
+            canvasRenderer.drawImage(x - hw, y - hw, width, width, pixelData, true, false);
          }
          // save the dash pattern state in order to continue this dash pattern for next drawings 
          state.dashOn = dashOn;
@@ -811,7 +811,6 @@
          
          var cap = basicStroke.getCapEnum();
          var join = basicStroke.getJoinEnum();
-         
          var a = x2-x1;
          var b = y2-y1;
          
@@ -831,34 +830,70 @@
          if (b == 0)
          {
             l = Math.abs(a);
-            bx1 = x1;
-            by1 = y1 + w;
-            cx1 = x1;
-            cy1 = y1 - w;
-            bx2 = x2;
-            by2 = y2 + w;
-            cx2 = x2;
-            cy2 = y2 - w;
-            ax1 = x1;
-            ay1 = y1;
-            ax2 = x2;
-            ay2 = y2;
+            if (width == 1)
+            {
+               bx1 = x1;
+               by1 = y1 + 1;
+               cx1 = x1;
+               cy1 = y1;
+               bx2 = x2;
+               by2 = y2 + 1;
+               cx2 = x2;
+               cy2 = y2;
+               ax1 = x1;
+               ay1 = y1 + 0.5;
+               ax2 = x2;
+               ay2 = y2 + 0.5;
+            }
+            else
+            {
+               bx1 = x1;
+               by1 = y1 + w;
+               cx1 = x1;
+               cy1 = y1 - w;
+               bx2 = x2;
+               by2 = y2 + w;
+               cx2 = x2;
+               cy2 = y2 - w;
+               ax1 = x1;
+               ay1 = y1;
+               ax2 = x2;
+               ay2 = y2;
+            }
          }
          else if (a == 0)
          {
             l = Math.abs(b);
-            bx1 = x1 - w;
-            by1 = y1;
-            cx1 = x1 + w;
-            cy1 = y1;
-            bx2 = x2 - w;
-            by2 = y2;
-            cx2 = x2 + w;
-            cy2 = y2;
-            ax1 = x1;
-            ay1 = y1;
-            ax2 = x2;
-            ay2 = y2;
+            if (width == 1)
+            {
+               bx1 = x1;
+               by1 = y1;
+               cx1 = x1 + 1;
+               cy1 = y1;
+               bx2 = x2;
+               by2 = y2;
+               cx2 = x2 + 1;
+               cy2 = y2;
+               ax1 = x1 + 0.5;
+               ay1 = y1;
+               ax2 = x2 + 0.5;
+               ay2 = y2;
+            }
+            else
+            {
+               bx1 = x1 - w;
+               by1 = y1;
+               cx1 = x1 + w;
+               cy1 = y1;
+               bx2 = x2 - w;
+               by2 = y2;
+               cx2 = x2 + w;
+               cy2 = y2;
+               ax1 = x1;
+               ay1 = y1;
+               ax2 = x2;
+               ay2 = y2;
+            }
          }
          else
          {
@@ -878,8 +913,8 @@
             ay2 = y2;
          }
          
-         curr.push([x1, y1, l, bx1, by1, cx1, cy1]);
-         curr.push([x2, y2, l, bx2, by2, cx2, cy2]);
+         curr.push([ax1, ay1, l, bx1, by1, cx1, cy1]);
+         curr.push([ax2, ay2, l, bx2, by2, cx2, cy2]);
          
          if (prev.length == 2 && join == JOIN_MITER)
          {
@@ -1048,7 +1083,7 @@
        */
       this.strokePoint = function(x, y)
       {
-         canvasRenderer.drawImage(x - w - canvasRenderer.origin.x, y - w - canvasRenderer.origin.y, width, width, pixelData);
+         canvasRenderer.drawImage(x - w, y - w, width, width, pixelData, true, false);
       }
    }
 

