Skip to content

fix shape stroke thickness#3854

Open
Ayush2k02 wants to merge 2 commits intoGraphiteEditor:masterfrom
Ayush2k02:fix-shape-stroke-thickness
Open

fix shape stroke thickness#3854
Ayush2k02 wants to merge 2 commits intoGraphiteEditor:masterfrom
Ayush2k02:fix-shape-stroke-thickness

Conversation

@Ayush2k02
Copy link
Contributor

@Ayush2k02 Ayush2k02 commented Mar 3, 2026

Fixes the regression from #3789 and the discord discussion

https://discord.com/channels/731730685944922173/731738914812854303/1478349441818951701

Screen.Recording.2026-03-04.at.4.58.30.AM.mov

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 resolves a rendering regression where shape stroke thickness was incorrectly applied due to an improper order of operations within the node chain. By reordering the application of stroke, fill, and transform messages, shapes now render with their strokes correctly positioned, ensuring visual accuracy and consistency.

Highlights

  • Stroke Application Order: The order in which stroke, fill, and transform operations are applied to shapes has been reordered. Previously, the stroke was applied early in the node chain, leading to incorrect rendering.
  • Corrected Node Chain Logic: The change ensures that the stroke is applied at the end of the node chain (closest to the generator) for various shapes like polygons, stars, circles, arrows, and lines, aligning with the desired rendering hierarchy of Shape → Stroke → Transform → Fill.
  • Regression Fix: This pull request specifically addresses a regression introduced in a previous change (Swap the default placement order of Fill and Stroke nodes in layers #3789) and resolves related discussions on Discord regarding incorrect stroke thickness rendering.
Changelog
  • editor/src/messages/tool/tool_messages/shape_tool.rs
    • Reordered the application of apply_stroke calls to occur after apply_fill and TransformSet for various shape types.
    • Added a comment explaining the significance of node insertion order for correct rendering hierarchy.
Activity
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly fixes the stroke thickness regression by reordering the application of fill, transform, and stroke operations for shapes. The added comment explaining the node insertion order is very helpful. I've suggested a small refactoring to reduce code duplication by moving the common apply_stroke call out of the match statement. Overall, this is a good fix.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@Ayush2k02 Ayush2k02 force-pushed the fix-shape-stroke-thickness branch from 1751d67 to e6a1fae Compare March 3, 2026 20:47
@Keavon
Copy link
Member

Keavon commented Mar 3, 2026

The whole point of my change was to move stroke directly before fill. The bug is that the Transform node gets stuck between the two. Judging by your before-and-after screenshots, it looks like you've merely reverted my change, not fixed the scenario where the Transform node incorrectly gets stuck in between.

@Ayush2k02 Ayush2k02 force-pushed the fix-shape-stroke-thickness branch 3 times, most recently from 24f5024 to 97d7576 Compare March 3, 2026 23:27
@Ayush2k02 Ayush2k02 force-pushed the fix-shape-stroke-thickness branch from 97d7576 to 6e8e5c5 Compare March 3, 2026 23:35
@Ayush2k02
Copy link
Contributor Author

@Keavon , updated the branch with
transform -> stroke -> fill . Don't see the transform node getting stuck in between and causing bold strokes , while preserving the stroke and fill order from the regression PR . Can you review this once again !

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.

2 participants