From 26011728f9b9d0563f9f4619fc9609ccd5f0975c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 23 Jan 2020 21:15:51 +0100 Subject: [PATCH] cc_frm: fix offset in center mode Items were not precise centered. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/121efbebd4395ba7eb85346eecc2e4bcd4e7f8de Author: Thilo Graf Date: 2020-01-23 (Thu, 23 Jan 2020) --- src/gui/components/cc_frm.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 3d9d7074d..c9883257f 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -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);