fix checkbox crash
This commit is contained in:
parent
7e89ed8a98
commit
5e6fcd8217
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue