浏览代码

Fixed painting toolset line symmetry and rectangle radius

Krzysztof Krysiński 2 天之前
父节点
当前提交
c1a049bec8

+ 1 - 2
src/ChunkyImageLib/Operations/DrawingSurfaceLineOperation.cs

@@ -70,9 +70,8 @@ internal class DrawingSurfaceLineOperation : IMirroredDrawOperation
             newTo = (VecI)newTo.ReflectY((double)horAxisY).Round();
         }
 
-        Color color = paint.Paintable is ColorPaintable colorPaintable ? colorPaintable.Color : paint.Color;
 
-        return new DrawingSurfaceLineOperation(newFrom, newTo, paint.StrokeCap, paint.StrokeWidth, color, paint.BlendMode);
+        return new DrawingSurfaceLineOperation(newFrom, newTo, paint);
     }
 
     public void Dispose()

+ 1 - 1
src/ChunkyImageLib/Operations/RectangleOperation.cs

@@ -40,7 +40,7 @@ internal class RectangleOperation : IMirroredDrawOperation
         surf.Canvas.RotateRadians((float)Data.Angle, (float)rect.Center.X, (float)rect.Center.Y);
 
         double maxRadiusInPx = Math.Min(Data.Size.X, Data.Size.Y) / 2;
-        double radiusInPx = Data.CornerRadius * maxRadiusInPx;
+        double radiusInPx = Data.CornerRadius * Math.Abs(maxRadiusInPx);
 
         if (Data.AntiAliasing)
         {