-
Notifications
You must be signed in to change notification settings - Fork 22
Store bounding box parameters when moveToBoundingBox is called before viewport size is known #891
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: main
Are you sure you want to change the base?
Conversation
- Add optional pendingBounds member to MapCamera2d and MapCamera3d - Modify setBounds to defer bounds application when viewport size is 0 - Update viewportSizeChanged to apply pending bounds once size is known - This fixes the issue where setBounds called before size was known would be discarded Co-authored-by: maerki <6221466+maerki@users.noreply.github.com>
- Add null check before calling getRenderingContext()->getViewportSize() - Matches the pattern used in MapCamera3d - Prevents potential null pointer dereference Co-authored-by: maerki <6221466+maerki@users.noreply.github.com>
Co-authored-by: maerki <6221466+maerki@users.noreply.github.com>
|
@copilot Remove codeql and all those new files |
- Remove all _codeql_build_dir/ files accidentally committed - Remove _codeql_detected_source_root symlink - Add CodeQL paths to .gitignore to prevent future accidents Co-authored-by: maerki <6221466+maerki@users.noreply.github.com>
maerki
left a comment
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.
@copilot Change the public api (movetoboundingbox) instead. Dont commit changes to gitignorr
|
@copilot Start based on movetobounds, not setbounds |
- Revert changes to setBounds and .gitignore - Add PendingBoundingBox struct to store moveToBoundingBox parameters - Modify moveToBoundingBox to store parameters when viewport size is 0 - Modify viewportSizeChanged to apply pending bounding box - Implemented for both MapCamera2d and MapCamera3d Co-authored-by: maerki <6221466+maerki@users.noreply.github.com>
Changed to modify Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
🚨 Performance Regression Detected! 🚨 Some benchmarks have worsened in this PR. |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d5d335a9a2
ℹ️ 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".
| if self.renderToImage { | ||
| commandBuffer.commit() | ||
| commandBuffer.waitUntilCompleted() | ||
| } else { | ||
| } else if present { | ||
|
|
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.
Commit the command buffer even when not presenting
When present is false and renderToImage is also false, the command buffer is never committed, so the completion handler never fires and renderSemaphore is never signaled. This makes the frame a no‑op and can deadlock the next draw(in:) call (e.g., MCMapViewMapReadyCallbacks calls draw(in:present:false) before renderToImageResult(), so the subsequent render waits forever on the semaphore). You should still commit() (without presenting) in the non‑present path to ensure the GPU work runs and the semaphore is released.
Useful? React with 👍 / 👎.
Task: Set Bounds before size changed
Issue: Calling
moveToBoundingBoxbefore viewport size is known discards the call because a size is required for calculations.Goal: Store the bounding box parameters and apply them when viewport size is known.
Implementation Complete ✅
Changed approach based on feedback to modify the public API instead:
moveToBoundingBoxto store parameters when viewport size is unknownviewportSizeChangedChanges Made
MapCamera2d.h / MapCamera3d.h:
PendingBoundingBoxstruct to store parameters formoveToBoundingBoxcall when viewport size is not yet knownstd::optional<PendingBoundingBox> pendingBoundingBoxmember variableMapCamera2d.cpp:
moveToBoundingBox()to:pendingBoundingBoxif size is unknownpendingBoundingBoxand apply immediately if size is knownviewportSizeChanged()to apply pending bounding box when viewport size becomes knownMapCamera3d.cpp:
moveToBoundingBox()with same logic as MapCamera2dviewportSizeChanged()to apply pending bounding box when viewport size becomes knownTesting
✅ All existing tests pass without modification (1282 assertions in 46 test cases), confirming backward compatibility and no regressions.
Code Quality
Minimal changes - only modified the public API method as requested
Consistent with existing code patterns in both camera implementations
No breaking changes to the public API behavior
Fixes Set Bounds before size changed #890
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.