cc_frm: fix offset in center mode

Items were not precise centered.
This commit is contained in:
2020-01-20 17:16:45 +01:00
parent 50fc1bf09d
commit 21bd65bfa2

View File

@@ -504,8 +504,8 @@ void CComponentsForm::paintCCItems()
}
//positionize vertical centered
else if (xpos == CC_CENTERED){
auto_x = this_w/2 - w_item/2;
v_cc_items.at(i)->setRealXPos(this_x + auto_x + w_parent_frame);
auto_x = this_w/2 - w_item/2 - w_parent_frame/2;
v_cc_items.at(i)->setRealXPos(this_x + auto_x);
}
else{
v_cc_items.at(i)->setRealXPos(this_x + xpos + w_parent_frame);
@@ -525,8 +525,8 @@ void CComponentsForm::paintCCItems()
}
//positionize hor centered
else if (ypos == CC_CENTERED){
auto_y = height/2 - h_item/2;
v_cc_items.at(i)->setRealYPos(this_y + auto_y + w_parent_frame);
auto_y = height/2 - h_item/2 - w_parent_frame/2;
v_cc_items.at(i)->setRealYPos(this_y + auto_y);
}
else{
v_cc_items.at(i)->setRealYPos(this_y + ypos + w_parent_frame);