Conversation
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a154e13717
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| _watermarkStartX = WaterMarkCanvas.ActualWidth - BlackBoardWaterMark.ActualWidth - right; | ||
| // 转换为Left定位 | ||
| Canvas.SetRight(BlackBoardWaterMark, double.NaN); |
There was a problem hiding this comment.
Preserve x-position when switching from Right to Left anchor
When the watermark starts with only Canvas.Right set (the default XAML state), this branch clears Canvas.Right but never sets Canvas.Left. A simple click on the watermark without dragging then leaves both anchors unset, so WPF repositions it at the canvas origin on the next layout pass. This produces an unexpected jump to the left edge even though the user did not move it.
Useful? React with 👍 / 👎.
| if (newLeft + BlackBoardWaterMark.ActualWidth > WaterMarkCanvas.ActualWidth) | ||
| newLeft = WaterMarkCanvas.ActualWidth - BlackBoardWaterMark.ActualWidth; |
There was a problem hiding this comment.
Clamp watermark position after right-edge overflow math
The boundary logic can still produce a negative newLeft when the quote text is wider than the canvas: after clamping negative values to 0, this assignment overwrites it with ActualWidth - TextWidth, which is negative. In that case the saved position becomes off-screen, so users with long quotes or narrow windows can end up with a watermark they cannot fully bring back into view.
Useful? React with 👍 / 👎.
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 93ca8e778b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Settings.Appearance.IsWatermarkPositionCustomized = true; | ||
|
|
||
| // 延迟保存避免频繁写盘 | ||
| SaveSettingsToFile(); |
There was a problem hiding this comment.
Defer settings persistence until drag completes
Calling SaveSettingsToFile() on every MouseMove event writes the full settings JSON synchronously for each pointer update, which can cause visible UI stutter during dragging (especially on slower disks) and unnecessary disk churn. This handler already saves again on mouse-up, so persisting only at the end of the drag (or with an actual debounce/throttle) avoids a performance regression introduced by this feature.
Useful? React with 👍 / 👎.
| System.Windows.Controls.Canvas.SetLeft(BlackBoardWaterMark, Settings.Appearance.WatermarkPositionX); | ||
| System.Windows.Controls.Canvas.SetTop(BlackBoardWaterMark, Settings.Appearance.WatermarkPositionY); |
There was a problem hiding this comment.
Clamp restored watermark coordinates to current canvas
When loading a customized watermark position, the code applies stored WatermarkPositionX/Y directly without validating against the current WaterMarkCanvas size. If the user saved coordinates on a larger display and later opens on a smaller one, the watermark can load off-screen and become impossible to drag back through the UI. Clamp the restored values to the canvas bounds before assigning them.
Useful? React with 👍 / 👎.
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f38bda7e9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| private void InkCanvas_EndWatermarkAdjustment(object sender, MouseButtonEventArgs e) | ||
| { | ||
| EndWatermarkAdjustment(); | ||
| inkCanvas.MouseDown -= InkCanvas_EndWatermarkAdjustment; |
There was a problem hiding this comment.
Mark adjustment-exit clicks as handled
The exit handler ends adjustment mode but does not set e.Handled, so the same click continues through normal canvas input processing. In this app, inkCanvas already has a MouseDown handler (inkCanvas_MouseDown) that captures input and starts interaction, so when users click the canvas to finish watermark positioning, that click can also create an unintended stroke/dot in drawing workflows. Consuming the event (or handling this in preview phase) avoids modifying the board when the user is only trying to exit adjustment mode.
Useful? React with 👍 / 👎.
|
|
No description provided.