Merge branch 'master' into explicit-text-caching

This commit is contained in:
Héctor Ramón Jiménez 2023-09-10 00:34:21 +02:00
commit b8e5693a30
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
178 changed files with 1768 additions and 1388 deletions

View file

@ -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

View file

@ -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()),

View file

@ -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")]

View file

@ -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.