From c6659c9a29ae4299736a5e4de627cc8e105bd40b Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Wed, 6 Jul 2022 10:05:00 +0200 Subject: Fl_Cairo_Graphics_Driver: fix issues in string width computations when scaling applies. The implemented approach is to create and use the pango_layout_ object only relatively to an unscaled cairo context. With this, the pixel width of a drawn string equals the sum of the widths of its characters. --- src/drivers/Cairo/Fl_Cairo_Graphics_Driver.H | 1 + 1 file changed, 1 insertion(+) (limited to 'src/drivers/Cairo/Fl_Cairo_Graphics_Driver.H') diff --git a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.H b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.H index dfe67535e..255027e59 100644 --- a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.H +++ b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.H @@ -45,6 +45,7 @@ private: cairo_t *pango_layout_cairo_; PangoLayout *pango_layout_; int linestyle_; + int width_unscaled_(unsigned int c); protected: cairo_t *cairo_; public: -- cgit v1.2.3