cc_frm_footer: avoid division by 0

Origin commit data
------------------
Commit: f7a95bd3ac
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-06-30 (Fri, 30 Jun 2017)

Origin message was:
------------------
- cc_frm_footer: avoid division by 0
This commit is contained in:
vanhofen
2017-06-30 10:41:24 +02:00
parent 8cbcfcabaf
commit e4fdbbaa80

View File

@@ -333,10 +333,14 @@ void CComponentsFooter::paintButtons(const int& x_pos,
Font* font, Font* font,
bool do_save_bg) bool do_save_bg)
{ {
int lw = label_width;
if (label_count > 0 && label_width == 0)
lw = (w/label_count) - 2*cch_offset;
this->setDimensionsAll(x_pos, y_pos, w, h); this->setDimensionsAll(x_pos, y_pos, w, h);
this->setButtonFont(font); this->setButtonFont(font);
this->setContextButton(context_buttons); this->setContextButton(context_buttons);
this->setButtonLabels(content, label_count, 0, label_width ? label_width : (w/label_count) - 2*cch_offset); this->setButtonLabels(content, label_count, 0, lw);
this->paint(do_save_bg); this->paint(do_save_bg);
} }