mirror of
https://github.com/edubart/otclient.git
synced 2025-12-15 05:09:46 +01:00
Widgets can now rotate :O
This commit is contained in:
@@ -58,6 +58,11 @@ void UIWidget::draw(const Rect& visibleRect, Fw::DrawPane drawPane)
|
||||
if(m_clipping)
|
||||
g_painter->setClipRect(visibleRect);
|
||||
|
||||
if(m_rotation != 0.0f) {
|
||||
g_painter->pushTransformMatrix();
|
||||
g_painter->rotate(m_rect.center(), m_rotation * (Fw::pi / 180.0));
|
||||
}
|
||||
|
||||
drawSelf(drawPane);
|
||||
|
||||
if(m_children.size() > 0) {
|
||||
@@ -67,6 +72,9 @@ void UIWidget::draw(const Rect& visibleRect, Fw::DrawPane drawPane)
|
||||
drawChildren(visibleRect, drawPane);
|
||||
}
|
||||
|
||||
if(m_rotation != 0.0f)
|
||||
g_painter->popTransformMatrix();
|
||||
|
||||
if(m_clipping)
|
||||
g_painter->resetClipRect();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user