linebender / linebender/vello

Support "blurred rounded rect"s with non-uniform corner radii

Open
#1,245 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-research C-sparse-strips I-Blitz
Dominant language
Rust
Stars
4.3k
Forks
300
Avg merge
2d 13h
Merged PRs (30d)
61

Description

Vello [currently supports](https://docs.rs/vello/latest/vello/struct.Scene.html#method.draw_blurred_rounded_rect) "blurred rounded rectangles" (aka drop shadows) with a single corner radius for the entire rectangle. However, CSS [specifies](https://drafts.csswg.org/css-backgrounds/#border-radius) the border-radius property with 8 distinct radii (separate x-axis and y-axis radii for each of the 4 corners). If we wish to fully support rendering CSS `box-shadow`s with Vello then we will need a version of `blurred_rounded_rect` that supports 8 radii.

The CSS spec is also adding the [`corner-shape`](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/corner-shape) property which further generalizes the corners to be super-ellipse rather than merely a regular ellipse.

An illustration of the problem with the current solution is below. Here the border (yellow/red/green/black) and outline (blue) are being rendered with the correct geometry, but the box shadow (grey) is being rendered with a single corner radius and thus doesn't match the shape of other parts of the node.

Image

Contributor guide

No contributing guide indexed for this repository

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 Vello's Scene::draw_blurred_rounded_rect entry point and compare its current single-radius behavior with the CSS border-radius specification linked in the issue. Determine the API and geometry needed for eight independent radii, and clarify whether corner-shape support is in scope. Done means blurred rounded rectangles match the non-uniform corner geometry described by the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.