Browse Source

I don't get it

Krzysztof Krysiński 3 years ago
parent
commit
03a5000674
1 changed files with 8 additions and 8 deletions
  1. 8 8
      PixiEditor/Models/Tools/Tools/LineTool.cs

+ 8 - 8
PixiEditor/Models/Tools/Tools/LineTool.cs

@@ -53,25 +53,25 @@ namespace PixiEditor.Models.Tools.Tools
             Coordinates start = coordinates[0];
             Coordinates start = coordinates[0];
             Coordinates end = coordinates[^1];
             Coordinates end = coordinates[^1];
 
 
-            int x1 = start.X;
-            int y1 = start.Y;
-            int x = end.X;
-            int y = end.Y;
+            int x = start.X;
+            int y = start.Y;
+            int x1 = end.X;
+            int y1 = end.Y;
 
 
-            Int32Rect dirtyRect = new Int32Rect( // Idk why it sometimes doesn't add one x or y, @Equbuxu hulp
+            Int32Rect dirtyRect = new Int32Rect(
                 Math.Min(x, x1) - thickness,
                 Math.Min(x, x1) - thickness,
                 Math.Min(y, y1) - thickness,
                 Math.Min(y, y1) - thickness,
-                Math.Max(x1, x) + thickness, 
+                Math.Max(x1, x) + thickness,
                 Math.Max(y1, y) + thickness);
                 Math.Max(y1, y) + thickness);
             Int32Rect curLayerRect = new(layer.OffsetX, layer.OffsetY, layer.Width, layer.Height);
             Int32Rect curLayerRect = new(layer.OffsetX, layer.OffsetY, layer.Width, layer.Height);
             Int32Rect expanded = dirtyRect.Expand(curLayerRect);
             Int32Rect expanded = dirtyRect.Expand(curLayerRect);
 
 
-            layer.DynamicResize(expanded.X + expanded.Width, expanded.Y + expanded.Height, expanded.X, expanded.Y);
+            layer.DynamicResize(expanded.X + expanded.Width - 1, expanded.Y + expanded.Height - 1, expanded.X, expanded.Y);
 
 
             using (SKPaint paint = new SKPaint())
             using (SKPaint paint = new SKPaint())
             {
             {
                 paint.StrokeWidth = thickness;
                 paint.StrokeWidth = thickness;
-                paint.Style = SKPaintStyle.StrokeAndFill;
+                paint.Style = SKPaintStyle.Stroke;
                 paint.Color = color;
                 paint.Color = color;
                 layer.LayerBitmap.SkiaSurface.Canvas.DrawLine(x, y, x1, y1, paint);
                 layer.LayerBitmap.SkiaSurface.Canvas.DrawLine(x, y, x1, y1, paint);
             }
             }