Skip to content

Fix bookmark restore landing at wrong position when zoom differs - #1019

Closed
highperformancecoder with Copilot wants to merge 2 commits into
masterfrom
copilot/sf-1402-fix-bookmarking-issue
Closed

highperformancecoder with Copilot wants to merge 2 commits into
masterfrom
copilot/sf-1402-fix-bookmarking-issue

Conversation

Copilot AI commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Restoring a manual bookmark doesn't reproduce the saved view. The focus and scale come back different from what was bookmarked, which shows up when navigating nested groups by zooming.

Change in Group::gotoBookmark_b (model/group.cc)

  • A bookmark stores the group origin position (x, y) at the saved zoom level.
  • The old code called moveTo(b.x, b.y) and then zoom(x(), y(), ...). The zoom scales contents about the group origin, so the saved offset was distorted whenever the current zoom differed from the saved one.
  • The new code zooms first, then moves, so the group lands exactly at the saved position:
zoom(x(), y(), b.zoom/(relZoom*zoomFactor()));
moveTo(b.x, b.y);

Not verified

  • I haven't built this or run any tests. I also haven't tried it on the attached mmt.mky model.
  • Group::zoom only propagates to child groups when displayContents() is true and its state didn't just change. A bookmark that crosses that display threshold may still restore slightly off. That would be a separate cause and isn't addressed here.

This change is Reviewable

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 51bce0e8-bbcf-4d5f-9d69-fe08fb380fc9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-authored-by: highperformancecoder <3075825+highperformancecoder@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix manual bookmarking to save exact location Fix bookmark restore landing at wrong position when zoom differs Oct 18, 2026
@highperformancecoder

Copy link
Copy Markdown
Owner

Decided this was not an issue.

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.

[SF#1402] Manual bookmarking not saving exact location

2 participants