Return early when drawing image::Overlay if not visible

This commit is contained in:
Héctor Ramón Jiménez 2025-04-26 03:19:30 +02:00
parent c4e6e42759
commit 00e4de88bf
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -536,11 +536,12 @@ where
) { ) {
let bounds = layout.bounds(); let bounds = layout.bounds();
let clip_bounds = bounds.zoom(self.image.scale); let clip_bounds = bounds.zoom(self.image.scale);
let style = theme.style(&self.image.class);
let clip_bounds = clip_bounds let Some(clip_bounds) = clip_bounds.intersection(&self.viewport) else {
.intersection(&self.viewport) return;
.unwrap_or(self.viewport); };
let style = theme.style(&self.image.class);
if style.shadow.color.a > 0.0 { if style.shadow.color.a > 0.0 {
renderer.with_layer( renderer.with_layer(