Radial and conic gradient layers with more than 500 tiles are not drawn

Open
#1,496 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust

Research direction

Start in draw_gradient_layer, where the 500-tile limit currently returns without drawing; read how issue #1336 handles axis-aligned linear gradients. Explore whether a repeated single-tile image can cover radial and conic gradients, as the issue describes, and how that would fit the renderer’s gradient and image brush code. Done means the supplied 4px radial dot screen renders across the full area in Chrome, Firefox, and WebKit.

Written by the indexing model from the issue text.

Description

A-Paint C-Bug

A gradient background layer that needs more than 500 tiles is not drawn at all (if x.count * y.count > 500 { return; } in draw_gradient_layer). #1336 fixes this for axis-aligned linear gradients by painting one repeating fill. Radial and conic layers, like a halftone screen, still vanish:

<div style="width:400px; height:200px; background: radial-gradient(circle, #000 0.7px, transparent 1.3px) 0 0 / 4px 4px"></div>

Expected: a 4px dot screen (Chrome, Firefox, WebKit).
Actual: nothing: 100×50 = 5000 tiles.

One approach we tried: render a single tile into a small image (sampling the gradient at pixel centres, as browsers do), cache it per gradient and size, and fill the whole area with an image brush set to Extend::Repeat. It matched WebKit to the pixel on 4–16px tiles of radial gradients.

Dominant language
Rust
Stars
4.5k
Forks
281
Avg merge
6h 6m
Merged PRs (30d)
184

Getting set up

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.

More from DioxusLabs/blitz

All issues in DioxusLabs/blitz

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.