|
|
commit 7d5d2af5475f2ce8f6a0b6d0bee1f4a12c1d36aa
Author: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Wed May 4 08:28:12 2022 +0200
Commit: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Wed May 4 08:28:12 2022 +0200
Cairo: reduce vertical offset for text position needed by Fl_Text_Display.
src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx
index 0405036..e74a987 100644
--- src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx
+++ 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_);
[ Direct Link to Message ] | |
|
| |