From 5dc9e10627a82d0b72ed1735f802364d9d2d9315 Mon Sep 17 00:00:00 2001 From: corvid Date: Thu, 21 Jul 2011 01:29:53 +0000 Subject: work around a fl_width() bug Pretty easy workaround, yes? :) --- dw/fltkui.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'dw/fltkui.cc') diff --git a/dw/fltkui.cc b/dw/fltkui.cc index 5405d92e..788df084 100644 --- a/dw/fltkui.cc +++ b/dw/fltkui.cc @@ -539,8 +539,10 @@ void FltkEntryResource::sizeRequest (core::Requisition *requisition) if (displayed() && style) { FltkFont *font = (FltkFont*)style->font; fl_font(font->font,font->size); + /* WORKAROUND: fl_width(uint_t) is not working on non-xft X. + * Reported to FLTK as STR #2688 */ requisition->width = - (int)fl_width ('n') + (int)fl_width ("n") * (maxLength == UNLIMITED_MAX_LENGTH ? 10 : maxLength) + label_w + (2 * RELIEF_X_THICKNESS); requisition->ascent = font->ascent + RELIEF_Y_THICKNESS; @@ -657,8 +659,10 @@ void FltkMultiLineTextResource::sizeRequest (core::Requisition *requisition) if (style) { FltkFont *font = (FltkFont*)style->font; fl_font(font->font,font->size); + /* WORKAROUND: fl_width(uint_t) is not working on non-xft X. + * Reported to FLTK as STR #2688 */ requisition->width = - (int)fl_width ('n') * numCols + 2 * RELIEF_X_THICKNESS; + (int)fl_width ("n") * numCols + 2 * RELIEF_X_THICKNESS; requisition->ascent = RELIEF_Y_THICKNESS + font->ascent + (font->ascent + font->descent) * (numRows - 1); -- cgit v1.2.3