diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-06-23 11:48:24 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-06-23 11:48:24 (GMT) |
commit | 43b93b55f3352f8ee47c3738cd293fe3bc48a661 (patch) | |
tree | 95d8e76c15a9c004063ea3f58c2559f3f3b1b012 /generic/ttk/ttkLabel.c | |
parent | 2a8aa84ebc2dcbc33bab05beae43aea5309afa64 (diff) | |
download | tk-43b93b55f3352f8ee47c3738cd293fe3bc48a661.zip tk-43b93b55f3352f8ee47c3738cd293fe3bc48a661.tar.gz tk-43b93b55f3352f8ee47c3738cd293fe3bc48a661.tar.bz2 |
Fix -underline behavior in ttk::label, broken by TIP #660 changes.
Diffstat (limited to 'generic/ttk/ttkLabel.c')
-rw-r--r-- | generic/ttk/ttkLabel.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c index a4c3647..d94cb23 100644 --- a/generic/ttk/ttkLabel.c +++ b/generic/ttk/ttkLabel.c @@ -130,7 +130,7 @@ static void TextCleanup(TextElement *text) static void TextDraw(TextElement *text, Tk_Window tkwin, Drawable d, Ttk_Box b) { XColor *color = Tk_GetColorFromObj(tkwin, text->foregroundObj); - Tcl_Size underline = TCL_INDEX_NONE; + Tcl_Size underline = INT_MIN; XGCValues gcValues; GC gc1, gc2; Tk_Anchor anchor = TK_ANCHOR_CENTER; @@ -176,12 +176,12 @@ static void TextDraw(TextElement *text, Tk_Window tkwin, Drawable d, Ttk_Box b) if (text->underlineObj != NULL) { TkGetIntForIndex(text->underlineObj, TCL_INDEX_NONE, 0, &underline); - if (underline >= 0) { - if (underline < INT_MIN) { - underline = INT_MIN; - } else if (underline > INT_MAX) { - underline = INT_MAX; - } + if (underline < INT_MIN) { + underline = INT_MIN; + } else if (underline > INT_MAX) { + underline = INT_MAX; + } + if (underline != INT_MIN) { if (text->embossed) { Tk_UnderlineTextLayout(Tk_Display(tkwin), d, gc2, text->textLayout, b.x+1, b.y+1, underline); |