From 4a03eb69805f72e837e74a07eb3d1ff82ba0aa09 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 5 Jan 2017 10:22:49 +0100 Subject: [PATCH] CComponentsButton: fix height comparsion comparsion with itself --- src/gui/components/cc_frm_button.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index 18b3d31ea..96a0957fb 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -215,7 +215,7 @@ void CComponentsButton::initCaption() * Otherwise definied font will be used. Button dimensions are calculated from parent container (e.g. footer...). * These dimensions must be enough to display complete content like possible icon and without truncated text. */ - if ((cc_btn_font->getHeight()- 2*w_frame) > h_cap && (cc_btn_font->getRenderWidth(cc_btn_text)- 2*w_frame) > w_cap) + if ((cc_btn_font->getHeight()- 2*w_frame) > (height - 2*w_frame) && (cc_btn_font->getRenderWidth(cc_btn_text)- 2*w_frame) > w_cap) cc_btn_font = def_font; cc_btn_text_obj->setText(cc_btn_text, CTextBox::NO_AUTO_LINEBREAK, cc_btn_font);