Clip shadow bounds of floating images to the viewport
This commit is contained in:
parent
385cfcddb2
commit
c4e6e42759
1 changed files with 4 additions and 4 deletions
|
|
@ -538,6 +538,10 @@ where
|
||||||
let clip_bounds = bounds.zoom(self.image.scale);
|
let clip_bounds = bounds.zoom(self.image.scale);
|
||||||
let style = theme.style(&self.image.class);
|
let style = theme.style(&self.image.class);
|
||||||
|
|
||||||
|
let clip_bounds = clip_bounds
|
||||||
|
.intersection(&self.viewport)
|
||||||
|
.unwrap_or(self.viewport);
|
||||||
|
|
||||||
if style.shadow.color.a > 0.0 {
|
if style.shadow.color.a > 0.0 {
|
||||||
renderer.with_layer(
|
renderer.with_layer(
|
||||||
clip_bounds.expand(style.shadow.blur_radius),
|
clip_bounds.expand(style.shadow.blur_radius),
|
||||||
|
|
@ -558,10 +562,6 @@ where
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
let clip_bounds = clip_bounds
|
|
||||||
.intersection(&self.viewport)
|
|
||||||
.unwrap_or(self.viewport);
|
|
||||||
|
|
||||||
renderer.with_layer(clip_bounds, |renderer| {
|
renderer.with_layer(clip_bounds, |renderer| {
|
||||||
render(
|
render(
|
||||||
renderer,
|
renderer,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue