summaryrefslogtreecommitdiff
path: root/src/drivers/Cairo
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-05-04 08:28:12 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-05-04 08:28:12 +0200
commit7d5d2af5475f2ce8f6a0b6d0bee1f4a12c1d36aa (patch)
tree173c42929fe1e8e8a64463af1980995924040cc5 /src/drivers/Cairo
parenta6e2940792e85e8dbc3b898251ed4363c9d5fb19 (diff)
Cairo: reduce vertical offset for text position needed by Fl_Text_Display.
Diffstat (limited to 'src/drivers/Cairo')
-rw-r--r--src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx
index 04050364d..e74a987c0 100644
--- a/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx
+++ b/src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx
@@ -1125,8 +1125,8 @@ void Fl_Cairo_Graphics_Driver::font(Fl_Font fnum, Fl_Fontsize s) {
void Fl_Cairo_Graphics_Driver::draw(const char* str, int n, float x, float y) {
if (!n) return;
cairo_save(cairo_);
- // The -1 below is necessary for Fl_Text_Display at scale = 1
- cairo_translate(cairo_, x, y - height() + descent() -1);
+ // The -0.5 below makes underscores visible in Fl_Text_Display at scale = 1
+ cairo_translate(cairo_, x, y - height() + descent() -0.5);
pango_layout_set_text(pango_layout_, str, n);
pango_cairo_show_layout(cairo_, pango_layout_);
cairo_restore(cairo_);