Make the Outline render mode draw with consistent stroke thickness at any viewport zoom#3848
Make the Outline render mode draw with consistent stroke thickness at any viewport zoom#3848
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the handling of non-scaling stroke outlines by removing a dedicated Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors the non-scaling stroke feature by removing the non_scaling flag from the Stroke struct and instead calculating the stroke width at render time. This is a good architectural improvement. A new viewport_zoom parameter is added to RenderParams to correctly calculate the outline stroke width to be constant in screen space.
However, I found an issue in the max_scale helper function which is used for this calculation. It incorrectly uses the Frobenius norm, which leads to incorrect scaling of stroke widths. I've provided a suggestion to fix this. Other than that, the changes look good and consistent across the codebase.
There was a problem hiding this comment.
1 issue found across 7 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="node-graph/libraries/rendering/src/renderer.rs">
<violation number="1" location="node-graph/libraries/rendering/src/renderer.rs:202">
P2: Hash uses the raw `viewport_zoom` field, but rendering uses the `viewport_zoom()` method which normalizes `<= 0` to `1.0`. This means `RenderParams` with `viewport_zoom = 0.0` (the `Default`) and `viewport_zoom = 1.0` hash differently despite producing identical output, causing unnecessary cache invalidations. Hash the normalized value instead.
(Based on your team's feedback about avoiding misleading or inconsistent hashing implementations.) [FEEDBACK_USED]</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
ceb6592 to
a07a458
Compare
Closes #2526