Repository navigation
Dusk #697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: net10
Are you sure you want to change the base?
Dusk #697
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1532,6 +1532,7 @@ private void Window_Loaded(object sender, RoutedEventArgs e) | |
| { | ||
| LogHelper.WriteLogToFile($"[Startup] 主窗口加载开始,启动模式={App.CurrentStartupMode}", LogHelper.LogType.Info); | ||
| loadPenCanvas(); | ||
| ApplyInkEngine(Settings?.Canvas?.InkEngine ?? InkEngineType.Dusk); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At Severity: medium 🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage. |
||
| // 工具栏插件化按钮先注入到容器,确保 LoadSettings 内部对 Cursor_Icon / Pen_Icon 等的访问非空。 | ||
| // Settings.Toolbar 此时尚为默认值(全部可见),与旧 XAML 行为一致。 | ||
| InitializeToolbarPlugins(); | ||
|
|
@@ -1991,6 +1992,7 @@ private void MainWindow_OnSizeChanged(object sender, SizeChangedEventArgs e) | |
| private void Window_Closed(object sender, EventArgs e) | ||
| { | ||
| LogHelper.WriteLogToFile("[Exit] 主窗口 Closed,开始释放资源", LogHelper.LogType.Info); | ||
| DisposeDuskEngine(); | ||
| RealtimeInkFrameScheduler.Clear(); | ||
| try | ||
| { | ||
|
|
@@ -3543,7 +3545,37 @@ internal bool SetCurrentToolMode(InkCanvasEditingMode newMode, Action additional | |
|
|
||
| // 执行模式切换 | ||
| inkCanvas.EditingMode = newMode; | ||
| SyncWinRTInkPipelineWithLogicalTool(); | ||
|
|
||
| if (Settings?.Canvas?.InkEngine == InkEngineType.Dusk) | ||
| { | ||
| // 同步切换 Dusk 原生内核墨迹引擎状态 | ||
| switch (newMode) | ||
| { | ||
| case InkCanvasEditingMode.Ink: | ||
| SetDuskCanvasActive(true); | ||
| SetDuskEditingMode(Dusk.Wpf.Shell.ShellEditingMode.Ink); | ||
| SyncDuskPenAttributes(drawingAttributes?.Color ?? Ink_DefaultColor, drawingAttributes != null && drawingAttributes.Width > 0 ? drawingAttributes.Width : 2.5); | ||
| break; | ||
| case InkCanvasEditingMode.EraseByPoint: | ||
| SetDuskCanvasActive(true); | ||
| SetDuskEditingMode(Dusk.Wpf.Shell.ShellEditingMode.EraseByPoint); | ||
| SetDuskEraserRadius(eraserWidth > 0 ? eraserWidth / 2 : 24.0); | ||
| break; | ||
| case InkCanvasEditingMode.EraseByStroke: | ||
| SetDuskCanvasActive(true); | ||
| SetDuskEditingMode(Dusk.Wpf.Shell.ShellEditingMode.EraseByStroke); | ||
| SetDuskEraserRadius(eraserWidth > 0 ? eraserWidth / 2 : 24.0); | ||
| break; | ||
| default: | ||
| SetDuskCanvasActive(false); | ||
| SetDuskEditingMode(Dusk.Wpf.Shell.ShellEditingMode.None); | ||
| break; | ||
| } | ||
| } | ||
| else | ||
| { | ||
| SyncWinRTInkPipelineWithLogicalTool(); | ||
| } | ||
|
|
||
| // 根据模式确定是否为鼠标模式(无工具模式) | ||
| bool isMouseMode = newMode == InkCanvasEditingMode.None; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -202,6 +202,7 @@ private void ClearStrokes(bool isErasedByCode) | |
| // here as well so page switches, loads and code/UI clears cannot leave them behind. | ||
| ClearSecAgentSceneElements(); | ||
| inkCanvas.Strokes.Clear(); | ||
| DuskClear(isErasedByCode); | ||
| // 只隐藏 hint,不暂停(ClearStrokes 在切换页面、保存加载时都会被调用, | ||
| // 设置 _edgeExpandHintSuspended 会导致后续书写永远无法触发提示)。 | ||
| HideEdgeExpandHint(); | ||
|
|
@@ -258,6 +259,7 @@ private void RestoreStrokes(bool isBackupMain = false) | |
| } | ||
|
|
||
| var targetIndex = isBackupMain ? 0 : CurrentWhiteboardIndex; | ||
| DuskSwitchSlot(targetIndex); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you check inserting a whiteboard page before an existing page at Severity: medium 🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage. |
||
|
|
||
| // 先清空当前画布的墨迹 | ||
| inkCanvas.Strokes.Clear(); | ||
|
|
@@ -811,6 +813,7 @@ private void DeleteWhiteBoardPageByIndex(int pageIndex) | |
| var deletingCurrentPluginPage = pageIndex == CurrentWhiteboardIndex; | ||
| if (deletingCurrentPluginPage) CaptureCurrentPluginPageStates(); | ||
| var removedPluginPage = RemovePluginWhiteboardPageId(pageIndex, oldPluginPageCount); | ||
| DuskDeleteSlot(pageIndex); | ||
|
|
||
| if (pageIndex == CurrentWhiteboardIndex) | ||
| { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At
Ink Canvas/MainWindow.xaml:252, Dusk strokes stay in the new canvas, whileSaveInkCanvasStrokesstill serializes onlyinkCanvas.Strokes(Ink Canvas/MainWindow_cs/MW_Save&OpenStrokes.cs:829) and no stroke bridge is installed. Could you check saving and reopening a page drawn with the now-default Dusk engine, which currently reports success while saving none of that ink?Severity: high
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.