diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index 33d828b99..e5f758398 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -118,20 +118,15 @@ void CComponentsText::initCCText() //define height from font size height = max(height, ct_font->getHeight()); - //text box dimensions - if (ct_box== NULL){ - //ensure that we have a new instance - delete ct_box; - ct_box = NULL; - } - //using of real x/y values to paint images if this text object is bound in a parent form int tx = x, ty = y; if (cc_parent){ tx = cc_xr; ty = cc_yr; } - ct_box = new CBox(); + //init text box dimensions + if (ct_box == NULL) + ct_box = new CBox(); ct_box->iX = tx+fr_thickness; ct_box->iY = ty+fr_thickness; ct_box->iWidth = width-2*fr_thickness;