linebender / linebender/druid

Glitches with rounded rectangles

Open
#764 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug shell/gtk
Dominant language
Rust
Stars
9.7k
Forks
565
PR merge metrics
No merged PRs in 30d

Description

I'm getting drawing glitches when drawing very large rounded rectangles, possibly caused by overflow somewhere. I'm not sure whether it's reasonable to expect such large rectangles to work at all, but given that widget layout happily works with infinite bounds, I think it isn't completely unreasonable. This is with gtk on linux.

Here is my attempt to draw a rounded rectangle with infinite width:
![infinite](https://user-images.githubusercontent.com/1448113/77788626-9c85a700-702f-11ea-8838-649d2f39eec1.png)

Here is my attempt to draw a rounded rectangle with width 1e7:
![1e7](https://user-images.githubusercontent.com/1448113/77788644-a5767880-702f-11ea-88c4-a710bd2d84d8.png)

And now with width 1e6, it works:
![1e6](https://user-images.githubusercontent.com/1448113/77788661-ab6c5980-702f-11ea-87c0-d16aa6e98eaf.png)

Sample code is [here](https://gist.github.com/jneem/4fa5d0bc3d9bca4d79961b56b4cc29fd), and you can change the width on line 13 of main.rs. The clipping on line 37 actually makes no difference.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Rust sample in main.rs, changing the width on line 13 and comparing the 1e6, 1e7, and infinite cases. Check the drawing path and the clipping call on line 37 while reproducing the GTK-on-Linux glitches. Done means the cause is identified and large rounded rectangles render without the reported artifacts, or the supported bounds are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, rust
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.