summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2020-02-20 05:51:18 +0100
committerLibravatar GitHub <noreply@github.com>2020-02-20 05:51:18 +0100
commit17271eae671a933a862dc85aa5b9956a7da70b28 (patch)
tree1a24e3eebb544b0bc8b0ebf2d92f330141f699bf /src
parent8d63c49ba1aa43407e0dab0a8e69d3f316a79279 (diff)
parent6f7247ca13181bcdfe1a3065215c1b3204723b84 (diff)
downloadiced-17271eae671a933a862dc85aa5b9956a7da70b28.tar.gz
iced-17271eae671a933a862dc85aa5b9956a7da70b28.tar.bz2
iced-17271eae671a933a862dc85aa5b9956a7da70b28.zip
Merge pull request #193 from hecrj/feature/canvas
Canvas widget for 2D graphics
Diffstat (limited to '')
-rw-r--r--src/application.rs5
-rw-r--r--src/lib.rs2
-rw-r--r--src/settings.rs9
3 files changed, 15 insertions, 1 deletions
diff --git a/src/application.rs b/src/application.rs
index 0a4b6d9e..374810cb 100644
--- a/src/application.rs
+++ b/src/application.rs
@@ -178,6 +178,11 @@ pub trait Application: Sized {
_settings.into(),
iced_wgpu::Settings {
default_font: _settings.default_font,
+ antialiasing: if _settings.antialiasing {
+ Some(iced_wgpu::settings::Antialiasing::MSAAx4)
+ } else {
+ None
+ },
},
);
diff --git a/src/lib.rs b/src/lib.rs
index 7e658ca2..d492db02 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -204,5 +204,5 @@ use iced_web as common;
pub use common::{
futures, Align, Background, Color, Command, Font, HorizontalAlignment,
- Length, Space, Subscription, Vector, VerticalAlignment,
+ Length, Point, Size, Space, Subscription, Vector, VerticalAlignment,
};
diff --git a/src/settings.rs b/src/settings.rs
index 77c7e0b9..32ec583c 100644
--- a/src/settings.rs
+++ b/src/settings.rs
@@ -16,6 +16,15 @@ pub struct Settings {
/// If `None` is provided, a default system font will be chosen.
// TODO: Add `name` for web compatibility
pub default_font: Option<&'static [u8]>,
+
+ /// If set to true, the renderer will try to perform antialiasing for some
+ /// primitives.
+ ///
+ /// Enabling it can produce a smoother result in some widgets, like the
+ /// `Canvas`, at a performance cost.
+ ///
+ /// By default, it is disabled.
+ pub antialiasing: bool,
}
#[cfg(not(target_arch = "wasm32"))]