Skip to content

Conversation

@ashishmohapatra240
Copy link
Contributor

Closes #3361

The Vello renderer was calling .unwrap() on stroke(), which returns an Option. When an element had no stroke defined, this caused a panic.

Used .as_ref().map_or(0., Stroke::effective_width) instead. This returns a stroke width of 0.0 when no stroke is present.

@Keavon Keavon requested a review from Copilot November 13, 2025 07:55
Copilot finished reviewing on behalf of Keavon November 13, 2025 07:57
Copy link

Copilot AI left a 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 fixes a crash in the Vello renderer that occurred when rendering elements without a defined stroke. The fix replaces two unsafe .unwrap() calls with safe .map_or() calls that default to a stroke width of 0.0.

  • Replaced .unwrap() with .as_ref().map_or(0., Stroke::effective_width) to safely handle missing strokes
  • Applied the fix in two locations where stroke width is used for bounding box inflation
  • Uses 0.0 as the default stroke width, which is appropriate since it results in no bounding box inflation when no stroke is present

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Keavon Keavon merged commit 2835fbc into GraphiteEditor:master Nov 13, 2025
10 checks passed
@Keavon
Copy link
Member

Keavon commented Nov 13, 2025

Thanks. Please comment in the issue this PR fixes.

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.

Vello renderer crash

2 participants