summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-05-01 22:32:40 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-05-01 22:32:40 +0200
commit573929d5ec99981ae3a4a0d675f1248932d56e61 (patch)
treef7a8b782715c3a4f4c0dc1ad6ea5f6f021a86eff /examples
parent555371f77e02c962c2312dab7f1f2510b03e352a (diff)
downloadiced-573929d5ec99981ae3a4a0d675f1248932d56e61.tar.gz
iced-573929d5ec99981ae3a4a0d675f1248932d56e61.tar.bz2
iced-573929d5ec99981ae3a4a0d675f1248932d56e61.zip
Use `Path::rectangle` directly in `color_palette`
Diffstat (limited to 'examples')
-rw-r--r--examples/color_palette/src/main.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/examples/color_palette/src/main.rs b/examples/color_palette/src/main.rs
index 243fae1d..ff399e76 100644
--- a/examples/color_palette/src/main.rs
+++ b/examples/color_palette/src/main.rs
@@ -170,9 +170,7 @@ impl canvas::Drawable for Theme {
x: (i as f32) * box_size.width,
y: 0.0,
};
- let rect = Path::new(|path| {
- path.rectangle(anchor, box_size);
- });
+ let rect = Path::rectangle(anchor, box_size);
frame.fill(&rect, Fill::Color(color));
if self.base == color {
@@ -242,9 +240,8 @@ impl canvas::Drawable for Theme {
x: (i as f32) * box_size.width,
y: box_size.height + 2.0 * pad,
};
- let rect = Path::new(|path| {
- path.rectangle(anchor, box_size);
- });
+
+ let rect = Path::rectangle(anchor, box_size);
frame.fill(&rect, Fill::Color(color));
frame.fill_text(canvas::Text {