Pull logic for clamping corner rounding radii out of Corners::to_pixels (#27460)

This seems more correct as corners are not necessarily only for rounding
radii.

Also applies clamping after scaling in `paint_quad`, deduplicating that
logic. This also provides a more precise result by doing the clamping
after scaling, avoiding floating point rounding issues (probably a
non-issue).

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-03-25 15:56:17 -06:00 committed by GitHub
parent 76192ea93c
commit 8c8f50d916
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 55 additions and 27 deletions

View file

@ -421,7 +421,7 @@ impl Element for Img {
window,
cx,
|style, window, cx| {
let corner_radii = style.corner_radii.to_pixels(bounds.size, window.rem_size());
let corner_radii = style.corner_radii.to_pixels(window.rem_size());
if let Some(Ok(data)) = source.use_data(window, cx) {
let new_bounds = self