summaryrefslogtreecommitdiffstats
path: root/graphics/src/image.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-08-04 03:28:43 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-08-04 03:28:43 +0200
commit0ceee1cf3ae49f5bd0e3f2b346a4b34076e4523a (patch)
treec44e036220ea40734a00bb8e05e4afa6a9504bea /graphics/src/image.rs
parent87a613edd186461f1a8d224394043527a372571c (diff)
downloadiced-0ceee1cf3ae49f5bd0e3f2b346a4b34076e4523a.tar.gz
iced-0ceee1cf3ae49f5bd0e3f2b346a4b34076e4523a.tar.bz2
iced-0ceee1cf3ae49f5bd0e3f2b346a4b34076e4523a.zip
Implement image support for `canvas` widget
Diffstat (limited to '')
-rw-r--r--graphics/src/image.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/graphics/src/image.rs b/graphics/src/image.rs
index 318592be..0e8f2fe3 100644
--- a/graphics/src/image.rs
+++ b/graphics/src/image.rs
@@ -23,6 +23,12 @@ pub enum Image {
/// The opacity of the image.
opacity: f32,
+
+ /// If set to `true`, the image will be snapped to the pixel grid.
+ ///
+ /// This can avoid graphical glitches, specially when using a
+ /// [`image::FilterMethod::Nearest`].
+ snap: bool,
},
/// A vector image.
Vector {