fix checkbox crash

This commit is contained in:
Eduardo Bart 2011-11-16 00:50:48 -02:00
parent 7e89ed8a98
commit 5e6fcd8217
1 changed files with 13 additions and 9 deletions

View File

@ -29,16 +29,20 @@
void UICheckBox::render() void UICheckBox::render()
{ {
Rect boxRect; if(m_image) {
boxRect.setSize(m_boxSize); Rect boxRect;
boxRect.moveLeft(m_rect.left()); boxRect.setSize(m_boxSize);
boxRect.moveVerticalCenter(m_rect.verticalCenter()); boxRect.moveLeft(m_rect.left());
g_graphics.bindColor(m_backgroundColor); boxRect.moveVerticalCenter(m_rect.verticalCenter());
m_image->draw(boxRect); g_graphics.bindColor(m_backgroundColor);
m_image->draw(boxRect);
}
Rect textRect(m_rect); if(m_text.length()) {
textRect.setTopLeft(textRect.topLeft() + m_textOffset); Rect textRect(m_rect);
m_font->renderText(m_text, textRect, Fw::AlignLeft, m_foregroundColor); textRect.setTopLeft(textRect.topLeft() + m_textOffset);
m_font->renderText(m_text, textRect, Fw::AlignLeft, m_foregroundColor);
}
} }
void UICheckBox::onMouseRelease(const Point& mousePos, Fw::MouseButton button) void UICheckBox::onMouseRelease(const Point& mousePos, Fw::MouseButton button)