Browse Source

special treatment of 100 hardness

flabbet 8 months ago
parent
commit
cf924a7a69

+ 2 - 1
src/PixiEditor.ChangeableDocument/Changes/Drawing/LineBasedPen_UpdateableChange.cs

@@ -136,12 +136,13 @@ internal class LineBasedPen_UpdateableChange : UpdateableChange
 
 
     private void ApplySoftnessGradient(VecD pos)
     private void ApplySoftnessGradient(VecD pos)
     {
     {
+        if (hardness >= 1) return;
         srcPaint.Shader?.Dispose();
         srcPaint.Shader?.Dispose();
         float radius = strokeWidth / 2f;
         float radius = strokeWidth / 2f;
         radius = MathF.Max(1, radius);
         radius = MathF.Max(1, radius);
         srcPaint.Shader = Shader.CreateRadialGradient(
         srcPaint.Shader = Shader.CreateRadialGradient(
             pos, radius, [color, color.WithAlpha(0)],
             pos, radius, [color, color.WithAlpha(0)],
-            [hardness - 0.03f, 1f], ShaderTileMode.Clamp);
+            [hardness - 0.04f, 1f], ShaderTileMode.Clamp);
     }
     }
 
 
     public override OneOf<None, IChangeInfo, List<IChangeInfo>> Apply(Document target, bool firstApply,
     public override OneOf<None, IChangeInfo, List<IChangeInfo>> Apply(Document target, bool firstApply,