CComponentsButton: reduce scope of variable face_x

The scope of the variable 'face_x' can be reduced. (style)
This commit is contained in:
2013-12-24 15:30:35 +01:00
parent abe1de16b0
commit 9ac35f0d92

View File

@@ -136,14 +136,13 @@ void CComponentsButton::initCaption()
//if we have an icon, we must calculate positions for booth items together //if we have an icon, we must calculate positions for booth items together
//also the icon width and left position = 0 //also the icon width and left position = 0
int face_w = 0; int face_w = 0;
int face_x = 0;
//calculate width and left position of icon, if available, picture position is default centered //calculate width and left position of icon, if available, picture position is default centered
if (cc_btn_icon_obj){ if (cc_btn_icon_obj){
//if found a picture object, then get width from it... //if found a picture object, then get width from it...
face_w = cc_btn_icon_obj->getWidth(); face_w = cc_btn_icon_obj->getWidth();
//...and set position as centered //...and set position as centered
face_x = width/2 - face_w/2; int face_x = width/2 - face_w/2;
cc_btn_icon_obj->setXPos(face_x); cc_btn_icon_obj->setXPos(face_x);
} }