fix:光标显示功能
修复开启后不显示的问题
This commit is contained in:
@@ -1828,6 +1828,11 @@ namespace Ink_Canvas
|
|||||||
private void inkCanvas_MouseMove(object sender, MouseEventArgs e)
|
private void inkCanvas_MouseMove(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
if (isMouseDown) MouseTouchMove(e.GetPosition(inkCanvas));
|
if (isMouseDown) MouseTouchMove(e.GetPosition(inkCanvas));
|
||||||
|
|
||||||
|
if (Settings.Canvas.IsShowCursor)
|
||||||
|
{
|
||||||
|
SetCursorBasedOnEditingMode(inkCanvas);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void inkCanvas_MouseUp(object sender, MouseButtonEventArgs e)
|
private void inkCanvas_MouseUp(object sender, MouseButtonEventArgs e)
|
||||||
@@ -2054,13 +2059,21 @@ namespace Ink_Canvas
|
|||||||
}
|
}
|
||||||
private void MainWindow_OnMouseMove(object sender, MouseEventArgs e)
|
private void MainWindow_OnMouseMove(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.StylusDevice == null)
|
if (Settings.Canvas.IsShowCursor)
|
||||||
{
|
{
|
||||||
System.Windows.Forms.Cursor.Show();
|
System.Windows.Forms.Cursor.Show();
|
||||||
|
SetCursorBasedOnEditingMode(inkCanvas);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
System.Windows.Forms.Cursor.Hide();
|
if (e.StylusDevice == null)
|
||||||
|
{
|
||||||
|
System.Windows.Forms.Cursor.Show();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
System.Windows.Forms.Cursor.Hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -289,33 +289,11 @@ namespace Ink_Canvas
|
|||||||
LogHelper.WriteLogToFile("保持当前线擦模式");
|
LogHelper.WriteLogToFile("保持当前线擦模式");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SetCursorBasedOnEditingMode(inkCanvas);
|
|
||||||
|
|
||||||
inkCanvas.CaptureStylus();
|
inkCanvas.CaptureStylus();
|
||||||
ViewboxFloatingBar.IsHitTestVisible = false;
|
ViewboxFloatingBar.IsHitTestVisible = false;
|
||||||
BlackboardUIGridForInkReplay.IsHitTestVisible = false;
|
BlackboardUIGridForInkReplay.IsHitTestVisible = false;
|
||||||
|
|
||||||
// 确保手写笔模式下显示光标
|
SetCursorBasedOnEditingMode(inkCanvas);
|
||||||
if (Settings.Canvas.IsShowCursor)
|
|
||||||
{
|
|
||||||
inkCanvas.ForceCursor = true;
|
|
||||||
inkCanvas.UseCustomCursor = true;
|
|
||||||
|
|
||||||
// 根据当前编辑模式设置不同的光标
|
|
||||||
if (inkCanvas.EditingMode == InkCanvasEditingMode.EraseByPoint)
|
|
||||||
{
|
|
||||||
inkCanvas.Cursor = Cursors.Arrow;
|
|
||||||
}
|
|
||||||
else if (inkCanvas.EditingMode == InkCanvasEditingMode.Ink)
|
|
||||||
{
|
|
||||||
var sri = Application.GetResourceStream(new Uri("Resources/Cursors/Pen.cur", UriKind.Relative));
|
|
||||||
if (sri != null)
|
|
||||||
inkCanvas.Cursor = new Cursor(sri.Stream);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 强制显示光标
|
|
||||||
System.Windows.Forms.Cursor.Show();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (inkCanvas.EditingMode == InkCanvasEditingMode.EraseByPoint
|
if (inkCanvas.EditingMode == InkCanvasEditingMode.EraseByPoint
|
||||||
|| inkCanvas.EditingMode == InkCanvasEditingMode.EraseByStroke
|
|| inkCanvas.EditingMode == InkCanvasEditingMode.EraseByStroke
|
||||||
@@ -416,6 +394,7 @@ namespace Ink_Canvas
|
|||||||
inkCanvas.ReleaseStylusCapture();
|
inkCanvas.ReleaseStylusCapture();
|
||||||
ViewboxFloatingBar.IsHitTestVisible = true;
|
ViewboxFloatingBar.IsHitTestVisible = true;
|
||||||
BlackboardUIGridForInkReplay.IsHitTestVisible = true;
|
BlackboardUIGridForInkReplay.IsHitTestVisible = true;
|
||||||
|
SetCursorBasedOnEditingMode(inkCanvas);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MainWindow_StylusMove(object sender, StylusEventArgs e)
|
private void MainWindow_StylusMove(object sender, StylusEventArgs e)
|
||||||
@@ -439,13 +418,7 @@ namespace Ink_Canvas
|
|||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
|
|
||||||
// 确保手写笔移动时光标保持可见
|
SetCursorBasedOnEditingMode(inkCanvas);
|
||||||
if (Settings.Canvas.IsShowCursor)
|
|
||||||
{
|
|
||||||
inkCanvas.ForceCursor = true;
|
|
||||||
inkCanvas.UseCustomCursor = true;
|
|
||||||
System.Windows.Forms.Cursor.Show();
|
|
||||||
}
|
|
||||||
|
|
||||||
var strokeVisual = GetStrokeVisual(e.StylusDevice.Id);
|
var strokeVisual = GetStrokeVisual(e.StylusDevice.Id);
|
||||||
var stylusPointCollection = e.GetStylusPoints(this);
|
var stylusPointCollection = e.GetStylusPoints(this);
|
||||||
|
|||||||
Reference in New Issue
Block a user