diff options
Diffstat (limited to 'renderer')
| -rw-r--r-- | renderer/Cargo.toml | 40 | ||||
| -rw-r--r-- | renderer/src/geometry.rs | 14 | ||||
| -rw-r--r-- | renderer/src/lib.rs | 13 | ||||
| -rw-r--r-- | renderer/src/settings.rs | 4 | 
4 files changed, 40 insertions, 31 deletions
diff --git a/renderer/Cargo.toml b/renderer/Cargo.toml index 89326d73..56e17209 100644 --- a/renderer/Cargo.toml +++ b/renderer/Cargo.toml @@ -1,14 +1,14 @@  [package]  name = "iced_renderer" -version = "0.1.0" -authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"] -edition = "2021" -description = "The official renderer for Iced" -license = "MIT" -repository = "https://github.com/iced-rs/iced" -documentation = "https://docs.rs/iced_renderer" -keywords = ["gui", "ui", "graphics", "interface", "widgets"] -categories = ["gui"] +description = "The official renderer for iced" +version.workspace = true +edition.workspace = true +authors.workspace = true +license.workspace = true +repository.workspace = true +homepage.workspace = true +categories.workspace = true +keywords.workspace = true  [features]  wgpu = ["iced_wgpu"] @@ -17,21 +17,15 @@ svg = ["iced_tiny_skia/svg", "iced_wgpu?/svg"]  geometry = ["iced_graphics/geometry", "iced_tiny_skia/geometry", "iced_wgpu?/geometry"]  tracing = ["iced_wgpu?/tracing"]  web-colors = ["iced_wgpu?/web-colors"] +webgl = ["iced_wgpu?/webgl"]  [dependencies] -raw-window-handle = "0.5" -thiserror = "1" -log = "0.4" +iced_graphics.workspace = true +iced_tiny_skia.workspace = true -[dependencies.iced_graphics] -version = "0.9" -path = "../graphics" +iced_wgpu.workspace = true +iced_wgpu.optional = true -[dependencies.iced_tiny_skia] -version = "0.1" -path = "../tiny_skia" - -[dependencies.iced_wgpu] -version = "0.11" -path = "../wgpu" -optional = true +log.workspace = true +raw-window-handle.workspace = true +thiserror.workspace = true 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()), diff --git a/renderer/src/lib.rs b/renderer/src/lib.rs index 2b282a0b..8bdf231d 100644 --- a/renderer/src/lib.rs +++ b/renderer/src/lib.rs @@ -1,3 +1,16 @@ +#![forbid(rust_2018_idioms)] +#![deny( +    unsafe_code, +    unused_results, +    clippy::extra_unused_lifetimes, +    clippy::from_over_into, +    clippy::needless_borrow, +    clippy::new_without_default, +    clippy::useless_conversion, +    rustdoc::broken_intra_doc_links +)] +#![allow(clippy::inherent_to_string, clippy::type_complexity)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))]  pub mod compositor;  #[cfg(feature = "geometry")] diff --git a/renderer/src/settings.rs b/renderer/src/settings.rs index 08f2099e..432eb8a0 100644 --- a/renderer/src/settings.rs +++ b/renderer/src/settings.rs @@ -1,9 +1,7 @@  use crate::core::{Font, Pixels};  use crate::graphics::Antialiasing; -/// The settings of a [`Backend`]. -/// -/// [`Backend`]: crate::Backend +/// The settings of a Backend.  #[derive(Debug, Clone, Copy, PartialEq)]  pub struct Settings {      /// The default [`Font`] to use.  | 
