Use Path::rectangle directly in color_palette
This commit is contained in:
parent
555371f77e
commit
573929d5ec
1 changed files with 3 additions and 6 deletions
|
|
@ -170,9 +170,7 @@ impl canvas::Drawable for Theme {
|
||||||
x: (i as f32) * box_size.width,
|
x: (i as f32) * box_size.width,
|
||||||
y: 0.0,
|
y: 0.0,
|
||||||
};
|
};
|
||||||
let rect = Path::new(|path| {
|
let rect = Path::rectangle(anchor, box_size);
|
||||||
path.rectangle(anchor, box_size);
|
|
||||||
});
|
|
||||||
frame.fill(&rect, Fill::Color(color));
|
frame.fill(&rect, Fill::Color(color));
|
||||||
|
|
||||||
if self.base == color {
|
if self.base == color {
|
||||||
|
|
@ -242,9 +240,8 @@ impl canvas::Drawable for Theme {
|
||||||
x: (i as f32) * box_size.width,
|
x: (i as f32) * box_size.width,
|
||||||
y: box_size.height + 2.0 * pad,
|
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(&rect, Fill::Color(color));
|
||||||
|
|
||||||
frame.fill_text(canvas::Text {
|
frame.fill_text(canvas::Text {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue