Underline does not appear in some fonts and scales (Windows,X11-noCairo) (#1308)
Build and Test / build-linux (push) Has been cancelled
Build and Test / build-wayland (push) Has been cancelled
Build and Test / build-macos (push) Has been cancelled
Build and Test / build-windows (push) Has been cancelled

This commit is contained in:
ManoloFLTK
2025-09-19 11:29:07 +02:00
parent 2705990eab
commit cd120b3ffb
3 changed files with 2 additions and 12 deletions
+2 -1
View File
@@ -979,7 +979,8 @@ int Fl_Scalable_Graphics_Driver::descent() {
void Fl_Scalable_Graphics_Driver::draw(const char *str, int n, int x, int y) {
if (!size_ || !font_descriptor()) font(FL_HELVETICA, FL_NORMAL_SIZE);
Fl_Region r2 = scale_clip(scale());
draw_unscaled(str, n, floor(x), floor(y));
int offset = (scale() == 1 ? 0 : -1); // for issue #1308
draw_unscaled(str, n, floor(x), floor(y + offset));
unscale_clip(r2);
}
-1
View File
@@ -79,7 +79,6 @@ public:
static HBITMAP calc_HBITMAP_mask(Fl_RGB_Image *mask);
void delete_bitmask(fl_uintptr_t bm) FL_OVERRIDE;
HBITMAP create_alphamask(int w, int h, int d, int ld, const uchar *array);
void draw(const char *str, int n, int x, int y) FL_OVERRIDE;
void draw_unscaled(const char* str, int n, int x, int y) FL_OVERRIDE;
void draw_unscaled(int angle, const char *str, int n, int x, int y) FL_OVERRIDE;
void rtl_draw_unscaled(const char* str, int n, int x, int y) FL_OVERRIDE;
@@ -593,16 +593,6 @@ exit_error:
return;
} // fl_text_extents
void Fl_GDI_Graphics_Driver::draw(const char *str, int n, int x, int y) {
if (!size_ || !font_descriptor()) font(FL_HELVETICA, FL_NORMAL_SIZE);
Fl_Region r2 = scale_clip(scale());
int offset = (scale() == 1 ? 0 : -1); // for issue #1308
draw_unscaled(str, n, floor(x), floor(y + offset));
unscale_clip(r2);
}
void Fl_GDI_Graphics_Driver::draw_unscaled(const char* str, int n, int x, int y) {
COLORREF oldColor = SetTextColor(gc_, fl_RGB());
// avoid crash if no font has been set yet