improve:实时笔锋

This commit is contained in:
2026-04-04 22:56:34 +08:00
parent 3cf1ea438b
commit 66afe271c5
4 changed files with 98 additions and 40 deletions
+17 -1
View File
@@ -542,7 +542,23 @@ namespace Ink_Canvas
var stylusPointCollection = e.GetStylusPoints(this);
foreach (var stylusPoint in stylusPointCollection)
strokeVisual.Add(new StylusPoint(stylusPoint.X, stylusPoint.Y, stylusPoint.PressureFactor));
strokeVisual.Redraw();
// 实时笔锋:在绘制过程中更新压感并整笔重绘预览;否则预览层固定线宽,收笔后改点集也看不到笔锋变化。
var committedStroke = strokeVisual.Stroke;
if (committedStroke != null
&& Settings.Canvas.InkStyle == 3
&& penType == 0
&& committedStroke.DrawingAttributes != null
&& !committedStroke.DrawingAttributes.IsHighlighter
&& committedStroke.StylusPoints.Count >= 3)
{
ApplyVelocityBrushTipFromSpeed(committedStroke);
strokeVisual.ForceRedraw();
}
else
{
strokeVisual.Redraw();
}
}
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
}