PR: #9931 broke image scaling, such that it ignores the object-fit parameter and instead always scales the image to fit the bounds. This fixes the regression.
This commit is contained in:
parent
3c8b376764
commit
b1ccead0f6
1 changed files with 2 additions and 1 deletions
|
@ -239,7 +239,8 @@ impl Element for Img {
|
||||||
let corner_radii = style.corner_radii.to_pixels(bounds.size, cx.rem_size());
|
let corner_radii = style.corner_radii.to_pixels(bounds.size, cx.rem_size());
|
||||||
|
|
||||||
if let Some(data) = source.data(cx) {
|
if let Some(data) = source.data(cx) {
|
||||||
cx.paint_image(bounds, corner_radii, data.clone(), self.grayscale)
|
let new_bounds = self.object_fit.get_bounds(bounds, data.size());
|
||||||
|
cx.paint_image(new_bounds, corner_radii, data.clone(), self.grayscale)
|
||||||
.log_err();
|
.log_err();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue