mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 22:54:36 +00:00
Fix baseline for text items
In the previous renderer the text, by default, is drawn at the top of the bounding box. The default femtovg alignment is more like QPainter, but that's not quite what we want here.
This commit is contained in:
parent
065d717814
commit
b61c1e3af7
1 changed files with 1 additions and 0 deletions
|
@ -535,6 +535,7 @@ impl ItemRenderer for GLItemRenderer {
|
||||||
);
|
);
|
||||||
paint.set_font(&[font.font_id]);
|
paint.set_font(&[font.font_id]);
|
||||||
paint.set_font_size(text.font_pixel_size(self.scale_factor()));
|
paint.set_font_size(text.font_pixel_size(self.scale_factor()));
|
||||||
|
paint.set_text_baseline(femtovg::Baseline::Top);
|
||||||
|
|
||||||
let text_str = sixtyfps_corelib::items::Text::FIELD_OFFSETS.text.apply_pin(text).get();
|
let text_str = sixtyfps_corelib::items::Text::FIELD_OFFSETS.text.apply_pin(text).get();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue