From 8d7fb4e0e33581fce60249a888a9e6fa1fd30fc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=BC=9F?= Date: Wed, 6 May 2026 16:15:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B0=94=E6=B3=A1=E6=B5=8B=E9=87=8F=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=EF=BC=9A=E4=BF=AE=E6=94=B9=E9=BC=A0=E6=A0=87=E5=85=89?= =?UTF-8?q?=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controls/PolygonRoiCanvas.xaml.cs | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/XP.ImageProcessing.RoiControl/Controls/PolygonRoiCanvas.xaml.cs b/XP.ImageProcessing.RoiControl/Controls/PolygonRoiCanvas.xaml.cs index 114bba8..56e7f05 100644 --- a/XP.ImageProcessing.RoiControl/Controls/PolygonRoiCanvas.xaml.cs +++ b/XP.ImageProcessing.RoiControl/Controls/PolygonRoiCanvas.xaml.cs @@ -418,7 +418,30 @@ namespace XP.ImageProcessing.RoiControl.Controls private bool _bubbleBrushDragging; private readonly System.Collections.Generic.Stack _bubbleUndoStack = new(); - public void SetBubbleTool(BubbleSubTool tool) => _bubbleTool = tool; + public void SetBubbleTool(BubbleSubTool tool) + { + _bubbleTool = tool; + // 根据工具设置光标 + UpdateBubbleToolCursor(); + } + + private void UpdateBubbleToolCursor() + { + if (mainCanvas == null) return; + if (CurrentMeasureMode != Models.MeasureMode.BubbleMeasure) + { + mainCanvas.Cursor = Cursors.Arrow; + return; + } + mainCanvas.Cursor = _bubbleTool switch + { + BubbleSubTool.Wand => Cursors.Cross, + BubbleSubTool.Brush => Cursors.Pen, + BubbleSubTool.Eraser => Cursors.No, + _ => Cursors.Arrow + }; + } + public void SetBubbleThreshold(int val) => _bubbleThreshold = val; public void SetBubbleBrushSize(int val) => _bubbleBrushSize = val; public void SetBubbleVoidLimit(double val) { _bubbleVoidLimit = val; UpdateBubbleResult(); }