-
-
Notifications
You must be signed in to change notification settings - Fork 86
Line Render order & orthographic camera min/max fixes #384
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
Conversation
✅ Deploy Preview for reagraph ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| if (isOrthographic && cameraRef.current) { | ||
| // Convert distance to zoom values (inverse relationship) | ||
| cameraRef.current.maxZoom = maxDistance | ||
| ? 50000 / minDistance |
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.
@AntonJames-Sistence Should we allow modification of this constant? Maybe better to add this as props with a default value to have the ability to change it if needed?
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.
@SerhiiTsybulskyi we can modify maxDistance/minDistance
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.
ok I think I need a better idea for this min/max zoom, because it actually doesn't work as expected
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.
@SerhiiTsybulskyi I had to add min/max zoom props, since there's no actual correlation between zoom and dolly, as I thought in the beginning
amcdnl
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.
Looks good overall but a few minor nits.
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.
Pull Request Overview
This PR addresses rendering order issues and orthographic camera zoom limits. It introduces customizable render order for line elements and fixes orthographic camera min/max zoom behavior.
Key changes:
- Add configurable render order support for Line and Edge components
- Fix orthographic camera zoom limits by converting distance parameters to zoom values
- Improve visual layering for active/selected edges
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/symbols/Line.tsx | Adds renderOrder prop with default value of -1 |
| src/symbols/Edge.tsx | Updates z-position logic and applies dynamic renderOrder based on state |
| src/CameraControls/CameraControls.tsx | Implements orthographic camera zoom limits using distance-to-zoom conversion |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| cameraRef.current.maxZoom = maxDistance | ||
| ? 50000 / minDistance | ||
| : undefined; | ||
| cameraRef.current.minZoom = minDistance | ||
| ? 50000 / maxDistance | ||
| : undefined; |
Copilot
AI
Sep 25, 2025
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.
The magic number 50000 is used for zoom calculations without explanation. Consider extracting this as a named constant with a descriptive comment explaining its purpose in the distance-to-zoom conversion formula.
| ? 50000 / minDistance | ||
| : undefined; | ||
| cameraRef.current.minZoom = minDistance | ||
| ? 50000 / maxDistance |
Copilot
AI
Sep 25, 2025
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.
The zoom limit calculation uses minDistance in the denominator when maxDistance exists, but this should use minDistance for maxZoom calculation. The logic appears reversed - maxZoom should be calculated from maxDistance, not minDistance.
| ? 50000 / minDistance | |
| : undefined; | |
| cameraRef.current.minZoom = minDistance | |
| ? 50000 / maxDistance | |
| ? 50000 / maxDistance | |
| : undefined; | |
| cameraRef.current.minZoom = minDistance | |
| ? 50000 / minDistance |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
GET-34 & GET-35
What is the new behavior?
render_order.mov
Does this PR introduce a breaking change?
Other information