|
@@ -12,7 +12,7 @@ internal class LineBasedPen_UpdateableChange : UpdateableChange
|
|
|
{
|
|
|
private readonly Guid memberGuid;
|
|
|
private readonly Color color;
|
|
|
- private int strokeWidth;
|
|
|
+ private float strokeWidth;
|
|
|
private readonly bool erasing;
|
|
|
private readonly bool drawOnMask;
|
|
|
private readonly bool antiAliasing;
|
|
@@ -26,7 +26,7 @@ internal class LineBasedPen_UpdateableChange : UpdateableChange
|
|
|
private VecF lastPos;
|
|
|
|
|
|
[GenerateUpdateableChangeActions]
|
|
|
- public LineBasedPen_UpdateableChange(Guid memberGuid, Color color, VecI pos, int strokeWidth, bool erasing,
|
|
|
+ public LineBasedPen_UpdateableChange(Guid memberGuid, Color color, VecI pos, float strokeWidth, bool erasing,
|
|
|
bool antiAliasing,
|
|
|
float hardness,
|
|
|
float spacing,
|
|
@@ -53,7 +53,7 @@ internal class LineBasedPen_UpdateableChange : UpdateableChange
|
|
|
}
|
|
|
|
|
|
[UpdateChangeMethod]
|
|
|
- public void Update(VecI pos, int strokeWidth)
|
|
|
+ public void Update(VecI pos, float strokeWidth)
|
|
|
{
|
|
|
points.Add(pos);
|
|
|
this.strokeWidth = strokeWidth;
|
|
@@ -91,13 +91,13 @@ internal class LineBasedPen_UpdateableChange : UpdateableChange
|
|
|
continue;
|
|
|
|
|
|
lastPos = point;
|
|
|
- var rect = new RectI(point - new VecI(strokeWidth / 2), new VecI(strokeWidth));
|
|
|
+ var rect = new RectI(point - new VecI((int)(strokeWidth / 2f)), new VecI((int)strokeWidth));
|
|
|
if (antiAliasing)
|
|
|
{
|
|
|
ApplySoftnessGradient((VecD)point);
|
|
|
}
|
|
|
|
|
|
- image.EnqueueDrawEllipse(rect, color, color, 0, 0, antiAliasing, srcPaint);
|
|
|
+ image.EnqueueDrawEllipse((RectD)rect, color, color, 0, 0, antiAliasing, srcPaint);
|
|
|
}
|
|
|
|
|
|
var affChunks = image.FindAffectedArea(opCount);
|
|
@@ -109,8 +109,8 @@ internal class LineBasedPen_UpdateableChange : UpdateableChange
|
|
|
{
|
|
|
if (points.Count == 1)
|
|
|
{
|
|
|
- var rect = new RectI(points[0] - new VecI(strokeWidth / 2), new VecI(strokeWidth));
|
|
|
- targetImage.EnqueueDrawEllipse(rect, color, color, 1, 0, antiAliasing, srcPaint);
|
|
|
+ var rect = new RectI(points[0] - new VecI((int)(strokeWidth / 2f)), new VecI((int)strokeWidth));
|
|
|
+ targetImage.EnqueueDrawEllipse((RectD)rect, color, color, 1, 0, antiAliasing, srcPaint);
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -124,13 +124,13 @@ internal class LineBasedPen_UpdateableChange : UpdateableChange
|
|
|
continue;
|
|
|
|
|
|
lastPos = points[i];
|
|
|
- var rect = new RectI(points[i] - new VecI(strokeWidth / 2), new VecI(strokeWidth));
|
|
|
+ var rect = new RectI(points[i] - new VecI((int)(strokeWidth / 2f)), new VecI((int)strokeWidth));
|
|
|
if (antiAliasing)
|
|
|
{
|
|
|
ApplySoftnessGradient(points[i]);
|
|
|
}
|
|
|
|
|
|
- targetImage.EnqueueDrawEllipse(rect, color, color, 0, 0, antiAliasing, srcPaint);
|
|
|
+ targetImage.EnqueueDrawEllipse((RectD)rect, color, color, 0, 0, antiAliasing, srcPaint);
|
|
|
}
|
|
|
}
|
|
|
|