CProgressBar/CVolumeBar: fix position of active/passive bar

Assign real position values to progressbar if is bound (embedded) in a form.
This is dependently from its own parent status. Status of cc_parent==NULL
means, it's not bound and without parent form so we use x/y, otherwise
we use real values stored by cc_xr/cc_yr.
Values in cc_xr/cc_yr and cc_parent were assigned with addCCItem().

Signed-off-by: Michael Liebmann <tuxcode.bbg@gmail.com>
This commit is contained in:
2013-06-02 13:51:12 +02:00
parent 3c5f4867fb
commit fb812f38e8
2 changed files with 23 additions and 9 deletions

View File

@@ -231,10 +231,23 @@ void CVolumeBar::paintVolumeBarDigit()
CTextBox* ctb = vb_digit->getCTextBoxObject();
if (ctb)
ctb->setFontUseDigitHeight();
// backup original x&y pos
int _dx = vb_digit->getXPos();
int _dy = vb_digit->getYPos();
// get real x&y pos
int dx = vb_digit->getRealXPos();
int dy = vb_digit->getRealYPos();
// set real x&y pos
vb_digit->setDimensionsAll(dx, dy, digit_w, height);
// paint digit
vb_digit->paint(CC_SAVE_SCREEN_NO);
// restore original x&y pos
vb_digit->setDimensionsAll(_dx, _dy, digit_w, height);
}