CComponentsExtTextForm: fix label width calculation

Origin commit data
------------------
Commit: 81cde4836f
Author: Thilo Graf <dbt@novatux.de>
Date: 2017-03-15 (Wed, 15 Mar 2017)
This commit is contained in:
2017-03-15 09:37:55 +01:00
parent 88b972aed4
commit 451f560459
2 changed files with 3 additions and 5 deletions

View File

@@ -86,8 +86,7 @@ void CComponentsExtTextForm::initVarExtTextForm(const int& x_pos, const int& y_p
width = w;
//init ccx_label_width and ccx_text_width
//default ccx_label_width = 30% of form width
ccx_percent_label_w = DEF_LABEL_WIDTH_PERCENT;
ccx_label_width = ccx_percent_label_w * width/100;
ccx_label_width = DEF_LABEL_WIDTH_PERCENT * width/100;
ccx_text_width = width-ccx_label_width;
height = h;
@@ -223,7 +222,8 @@ void CComponentsExtTextForm::initCCTextItems()
void CComponentsExtTextForm::setLabelWidthPercent(const uint8_t& percent_val)
{
ccx_percent_label_w = (int)percent_val;
ccx_label_width = (int)percent_val * width/100;
ccx_text_width = width-ccx_label_width;
initCCTextItems();
}