From a0a4cc1355ff6837d91c3cd8508b4cc65bf954ce Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 6 Jan 2014 00:58:02 +0100 Subject: [PATCH] CComponentsForm: avoid of height or width error due to odd values Some calculations can resulting odd values and can provocate unnecessary debug spam, but more lines should be repaired. --- src/gui/components/cc_frm.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index bfa2839ae..4a474bbb3 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -355,6 +355,9 @@ void CComponentsForm::paintCCItems() int right_item = cc_item->getRealXPos() + w_item; int w_diff = right_item - right_frm; int new_w = w_item - w_diff; + //avoid of width error due to odd values (1 line only) + right_item -= (new_w%2); + w_item -= (new_w%2); if (right_item > right_frm){ printf("[CComponentsForm] %s: [form: %d] [item-index %d] [type=%d] width is too large, definied width=%d, possible width=%d \n", __func__, cc_item_index, cc_item->getIndex(), cc_item->getItemType(), w_item, new_w); @@ -366,6 +369,9 @@ void CComponentsForm::paintCCItems() int bottom_item = cc_item->getRealYPos() + h_item; int h_diff = bottom_item - bottom_frm; int new_h = h_item - h_diff; + //avoid of height error due to odd values (1 line only) + bottom_item -= (new_h%2); + h_item -= (new_h%2); if (bottom_item > bottom_frm){ printf("[CComponentsForm] %s: [form: %d] [item-index %d] [type=%d] height is too large, definied height=%d, possible height=%d \n", __func__, cc_item_index, cc_item->getIndex(), cc_item->getItemType(), h_item, new_h);