Decouple caching from layering and simplify everything

This commit is contained in:
Héctor Ramón Jiménez 2024-04-05 23:59:21 +02:00
parent 4a356cfc16
commit 6d3e1d835e
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
15 changed files with 896 additions and 1199 deletions

View file

@ -405,7 +405,7 @@ where
#[cfg(feature = "geometry")]
mod geometry {
use super::Renderer;
use crate::core::{Point, Radians, Size, Vector};
use crate::core::{Point, Radians, Rectangle, Size, Vector};
use crate::graphics::geometry::{self, Fill, Path, Stroke, Text};
use crate::graphics::Cached;
@ -533,10 +533,10 @@ mod geometry {
delegate!(self, frame, frame.pop_transform());
}
fn draft(&mut self, size: Size) -> Self {
fn draft(&mut self, bounds: Rectangle) -> Self {
match self {
Self::Left(frame) => Self::Left(frame.draft(size)),
Self::Right(frame) => Self::Right(frame.draft(size)),
Self::Left(frame) => Self::Left(frame.draft(bounds)),
Self::Right(frame) => Self::Right(frame.draft(bounds)),
}
}