Skip to content

Preserve sketch-pad background in typing mode - #47

Open
Ehsan Azish (EhsanAzish80) wants to merge 2 commits into
microsoft:mainfrom
EhsanAzish80:fix/43-preserve-sketch-pad-typing
Open

Preserve sketch-pad background in typing mode#47
Ehsan Azish (EhsanAzish80) wants to merge 2 commits into
microsoft:mainfrom
EhsanAzish80:fix/43-preserve-sketch-pad-typing

Conversation

@EhsanAzish80

Copy link
Copy Markdown

Fixes #43.

Entering typing mode exits the drawing interaction state, but that transition also cleared blankScreen, causing the sketch-pad background to disappear while existing annotations remained.

This change preserves the blank-screen state when entering typing mode. Other drawing-mode exits continue to clear it normally.

A regression self-test verifies that:

  • entering typing mode preserves the sketch-pad background
  • normal drawing exits still clear it

Verification:

  • swift run ZoomItMacSelfTest passes
  • swift build --product ZoomIt passes

Copilot AI lite review requested due to automatic review settings August 10, 2026 14:31
@EhsanAzish80

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes Issue #43 by ensuring the sketch-pad “blank screen” background is not cleared when transitioning from drawing into typing mode, so the background remains visible while typing over existing annotations.

Changes:

  • Preserve blankScreen when entering .typing by passing a new clearBlankScreen parameter to exitDrawingMode.
  • Add a self-test intended to prevent regressions around blank-screen clearing behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
Sources/ZoomItMacCore/Overlay/ZoomCanvasView.swift Adds a clearBlankScreen option to exitDrawingMode and uses it when entering typing mode to preserve the sketch-pad background.
Sources/ZoomItMacCore/SelfTest/SelfTestRunner.swift Adds a regression-oriented self-test around blank-screen clearing policy.
Suppressed comments (1)

Sources/ZoomItMacCore/Overlay/ZoomCanvasView.swift:64

  • The comment says exitDrawingMode warps the system cursor, but in this typing-mode transition it’s called with restoreCursor: false, so no warp occurs. This is misleading and may confuse future changes around caret placement and cursor anchoring.
                // When coming from drawing, the pen dot is already tracked in
                // pointerViewPoint; exitDrawingMode warps the system cursor, so
                // don't re-read the mouse. Otherwise sync to the real cursor so
                // the caret appears under it and doesn't jump on the first move.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Sources/ZoomItMacCore/SelfTest/SelfTestRunner.swift
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 10, 2026 14:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: When in sketch pad, entering type mode removes sketch pad

2 participants