- cc_item_picture: reset keep_aspect variables after use

This commit is contained in:
svenhoefer
2016-11-12 22:00:12 +01:00
parent da604fb9a5
commit 73b97ecd4d

View File

@@ -216,17 +216,21 @@ void CComponentsPicture::initCCItem()
* by setters setWidth/setHeight * by setters setWidth/setHeight
* these steps are required to assign the current image dimensions to item dimensions * these steps are required to assign the current image dimensions to item dimensions
*/ */
if (keep_dx_aspect && dy){ if (keep_dx_aspect && dy)
{
float h_ratio = float(height)*100/(float)dy; float h_ratio = float(height)*100/(float)dy;
width = int(h_ratio*(float)dx/100); width = int(h_ratio*(float)dx/100);
#ifdef BOXMODEL_APOLLO #ifdef BOXMODEL_APOLLO
if (do_scale && (width > 10 || height > 10)) if (do_scale && (width > 10 || height > 10))
width = GetWidth4FB_HW_ACC(x+fr_thickness, width-2*fr_thickness)+2*fr_thickness; width = GetWidth4FB_HW_ACC(x+fr_thickness, width-2*fr_thickness)+2*fr_thickness;
#endif #endif
keep_dx_aspect = false;
} }
if (keep_dy_aspect && dx){ if (keep_dy_aspect && dx)
{
float w_ratio = float(width)*100/(float)dx; float w_ratio = float(width)*100/(float)dx;
height = int(w_ratio*(float)dy/100); height = int(w_ratio*(float)dy/100);
keep_dy_aspect = false;
} }
//resize image and apply current assigned scale values //resize image and apply current assigned scale values