diff options
Diffstat (limited to 'glow')
-rw-r--r-- | glow/Cargo.toml | 9 | ||||
-rw-r--r-- | glow/src/shader/quad.vert | 5 | ||||
-rw-r--r-- | glow/src/widget.rs | 8 | ||||
-rw-r--r-- | glow/src/widget/pane_grid.rs | 4 | ||||
-rw-r--r-- | glow/src/widget/qr_code.rs | 2 |
5 files changed, 22 insertions, 6 deletions
diff --git a/glow/Cargo.toml b/glow/Cargo.toml index 11ca80e2..0178f9f7 100644 --- a/glow/Cargo.toml +++ b/glow/Cargo.toml @@ -9,17 +9,18 @@ repository = "https://github.com/hecrj/iced" [features] canvas = ["iced_graphics/canvas"] +qr_code = ["iced_graphics/qr_code"] default_system_font = ["iced_graphics/font-source"] # Not supported yet! image = [] svg = [] [dependencies] -glow = "0.5" -glow_glyph = "0.3" +glow = "0.6" +glow_glyph = "0.4" glyph_brush = "0.7" -euclid = "0.20" -bytemuck = "1.2" +euclid = "0.22" +bytemuck = "1.4" log = "0.4" [dependencies.iced_native] diff --git a/glow/src/shader/quad.vert b/glow/src/shader/quad.vert index d37b5c8d..82417856 100644 --- a/glow/src/shader/quad.vert +++ b/glow/src/shader/quad.vert @@ -29,6 +29,11 @@ void main() { vec2 p_Pos = i_Pos * u_Scale; vec2 p_Scale = i_Scale * u_Scale; + float i_BorderRadius = min( + i_BorderRadius, + min(i_Scale.x, i_Scale.y) / 2.0 + ); + mat4 i_Transform = mat4( vec4(p_Scale.x + 1.0, 0.0, 0.0, 0.0), vec4(0.0, p_Scale.y + 1.0, 0.0, 0.0), diff --git a/glow/src/widget.rs b/glow/src/widget.rs index 0e33909d..b5c84c56 100644 --- a/glow/src/widget.rs +++ b/glow/src/widget.rs @@ -52,6 +52,14 @@ pub mod canvas; #[doc(no_inline)] pub use canvas::Canvas; +#[cfg(feature = "qr_code")] +#[cfg_attr(docsrs, doc(cfg(feature = "qr_code")))] +pub mod qr_code; + +#[cfg(feature = "qr_code")] +#[doc(no_inline)] +pub use qr_code::QRCode; + pub use iced_native::{Image, Space}; /// A container that distributes its contents vertically. diff --git a/glow/src/widget/pane_grid.rs b/glow/src/widget/pane_grid.rs index 3c47b562..f594473f 100644 --- a/glow/src/widget/pane_grid.rs +++ b/glow/src/widget/pane_grid.rs @@ -11,8 +11,8 @@ use crate::Renderer; pub use iced_native::pane_grid::{ - Axis, Configuration, Direction, DragEvent, Focus, KeyPressEvent, Node, - Pane, ResizeEvent, Split, State, + Axis, Configuration, Direction, DragEvent, Node, Pane, ResizeEvent, Split, + State, }; /// A collection of panes distributed using either vertical or horizontal splits diff --git a/glow/src/widget/qr_code.rs b/glow/src/widget/qr_code.rs new file mode 100644 index 00000000..7b1c2408 --- /dev/null +++ b/glow/src/widget/qr_code.rs @@ -0,0 +1,2 @@ +//! Encode and display information in a QR code. +pub use iced_graphics::qr_code::*; |