diff options
| author | 2023-09-10 00:34:21 +0200 | |
|---|---|---|
| committer | 2023-09-10 00:34:21 +0200 | |
| commit | b8e5693a3089d728b4f8d4b3b0b7197202ebd732 (patch) | |
| tree | 79a9f84f9920525657fbe03d53ce33bab09053d7 /renderer/src/geometry | |
| parent | 956512338905bac0b156fdaf16fe3c3e07e97a84 (diff) | |
| parent | a3489e4af960388e9f73988b88df361022a654a4 (diff) | |
| download | iced-b8e5693a3089d728b4f8d4b3b0b7197202ebd732.tar.gz iced-b8e5693a3089d728b4f8d4b3b0b7197202ebd732.tar.bz2 iced-b8e5693a3089d728b4f8d4b3b0b7197202ebd732.zip  | |
Merge branch 'master' into explicit-text-caching
Diffstat (limited to '')
| -rw-r--r-- | renderer/src/geometry.rs | 14 | 
1 files changed, 9 insertions, 5 deletions
diff --git a/renderer/src/geometry.rs b/renderer/src/geometry.rs index 04b5d9e6..1ecb0a43 100644 --- a/renderer/src/geometry.rs +++ b/renderer/src/geometry.rs @@ -96,13 +96,11 @@ impl Frame {      /// resulting glyphs will not be rotated or scaled properly.      ///      /// Additionally, all text will be rendered on top of all the layers of -    /// a [`Canvas`]. Therefore, it is currently only meant to be used for +    /// a `Canvas`. Therefore, it is currently only meant to be used for      /// overlays, which is the most common use case.      ///      /// Support for vectorial text is planned, and should address all these      /// limitations. -    /// -    /// [`Canvas`]: crate::widget::Canvas      pub fn fill_text(&mut self, text: impl Into<Text>) {          delegate!(self, frame, frame.fill_text(text));      } @@ -168,12 +166,18 @@ impl Frame {          delegate!(self, frame, frame.rotate(angle));      } -    /// Applies a scaling to the current transform of the [`Frame`]. +    /// Applies a uniform scaling to the current transform of the [`Frame`].      #[inline] -    pub fn scale(&mut self, scale: f32) { +    pub fn scale(&mut self, scale: impl Into<f32>) {          delegate!(self, frame, frame.scale(scale));      } +    /// Applies a non-uniform scaling to the current transform of the [`Frame`]. +    #[inline] +    pub fn scale_nonuniform(&mut self, scale: impl Into<Vector>) { +        delegate!(self, frame, frame.scale_nonuniform(scale)); +    } +      pub fn into_geometry(self) -> Geometry {          match self {              Self::TinySkia(frame) => Geometry::TinySkia(frame.into_primitive()),  | 
