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:
Simon Hausmann 2021-01-06 19:36:40 +01:00
parent 065d717814
commit b61c1e3af7

View file

@ -535,6 +535,7 @@ impl ItemRenderer for GLItemRenderer {
);
paint.set_font(&[font.font_id]);
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();