Use FillTessellator::tessellate_rectangle in Frame
This commit is contained in:
parent
82d967c04f
commit
59b3d724ed
1 changed files with 8 additions and 10 deletions
|
|
@ -118,8 +118,6 @@ impl Frame {
|
||||||
size: Size,
|
size: Size,
|
||||||
fill: impl Into<Fill>,
|
fill: impl Into<Fill>,
|
||||||
) {
|
) {
|
||||||
use lyon::path::builder::PathBuilder;
|
|
||||||
|
|
||||||
let Fill { color, rule } = fill.into();
|
let Fill { color, rule } = fill.into();
|
||||||
|
|
||||||
let mut buffers = tessellation::BuffersBuilder::new(
|
let mut buffers = tessellation::BuffersBuilder::new(
|
||||||
|
|
@ -140,14 +138,14 @@ impl Frame {
|
||||||
let options =
|
let options =
|
||||||
tessellation::FillOptions::default().with_fill_rule(rule.into());
|
tessellation::FillOptions::default().with_fill_rule(rule.into());
|
||||||
|
|
||||||
let mut builder = self.fill_tessellator.builder(&options, &mut buffers);
|
let _ = self
|
||||||
|
.fill_tessellator
|
||||||
builder.add_rectangle(
|
.tessellate_rectangle(
|
||||||
&lyon::math::Rect::new(top_left, size.into()),
|
&lyon::math::Rect::new(top_left, size.into()),
|
||||||
lyon::path::Winding::Positive,
|
&options,
|
||||||
);
|
&mut buffers,
|
||||||
|
)
|
||||||
let _ = builder.build().expect("Fill rectangle");
|
.expect("Fill rectangle");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Draws the stroke of the given [`Path`] on the [`Frame`] with the
|
/// Draws the stroke of the given [`Path`] on the [`Frame`] with the
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue