mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 22:01:13 +00:00
Add support for Path.fill-rule
For some reason it's not working with the Qt renderer though
This commit is contained in:
parent
600186220c
commit
2dd5ea61bb
16 changed files with 102 additions and 14 deletions
|
@ -18,7 +18,8 @@ use sixtyfps_corelib::graphics::{
|
|||
};
|
||||
use sixtyfps_corelib::item_rendering::{CachedRenderingData, ItemRenderer};
|
||||
use sixtyfps_corelib::items::{
|
||||
ImageFit, Item, TextHorizontalAlignment, TextOverflow, TextVerticalAlignment, TextWrap,
|
||||
FillRule, ImageFit, Item, TextHorizontalAlignment, TextOverflow, TextVerticalAlignment,
|
||||
TextWrap,
|
||||
};
|
||||
use sixtyfps_corelib::properties::Property;
|
||||
use sixtyfps_corelib::window::ComponentWindow;
|
||||
|
@ -820,7 +821,14 @@ impl ItemRenderer for GLItemRenderer {
|
|||
}
|
||||
}
|
||||
|
||||
let fill_paint = self.brush_to_paint(path.fill(), &mut fpath);
|
||||
let fill_paint = self.brush_to_paint(path.fill(), &mut fpath).map(|mut fill_paint| {
|
||||
fill_paint.set_fill_rule(match path.fill_rule() {
|
||||
FillRule::nonzero => femtovg::FillRule::NonZero,
|
||||
FillRule::evenodd => femtovg::FillRule::EvenOdd,
|
||||
});
|
||||
fill_paint
|
||||
});
|
||||
|
||||
let border_paint = self.brush_to_paint(path.stroke(), &mut fpath).map(|mut paint| {
|
||||
paint.set_line_width(path.stroke_width());
|
||||
paint
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue