mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 22:13:27 +02:00
rework map rendering
This commit is contained in:
@@ -90,7 +90,7 @@ void UIWidget::drawChildren()
|
||||
g_painter.setColor(Fw::green);
|
||||
g_painter.drawBoundingRect(child->getRect());
|
||||
}
|
||||
//g_fonts.getDefaultFont()->renderText(child->getId(), child->getPos() + Point(2, 0), Fw::red);
|
||||
//g_fonts.getDefaultFont()->renderText(child->getId(), child->getPosition() + Point(2, 0), Fw::red);
|
||||
|
||||
g_painter.setOpacity(oldOpacity);
|
||||
}
|
||||
|
@@ -189,7 +189,7 @@ protected:
|
||||
|
||||
// function shortcuts
|
||||
public:
|
||||
void resize(int width, int height) { setRect(Rect(getPos(), Size(width, height))); }
|
||||
void resize(int width, int height) { setRect(Rect(getPosition(), Size(width, height))); }
|
||||
void move(int x, int y) { setRect(Rect(x, y, getSize())); }
|
||||
void hide() { setVisible(false); }
|
||||
void show() { setVisible(true); }
|
||||
@@ -262,7 +262,7 @@ public:
|
||||
void setWidth(int width) { resize(width, getHeight()); }
|
||||
void setHeight(int height) { resize(getWidth(), height); }
|
||||
void setSize(const Size& size) { resize(size.width(), size.height()); }
|
||||
void setPos(const Point& pos) { move(pos.x, pos.y); }
|
||||
void setPosition(const Point& pos) { move(pos.x, pos.y); }
|
||||
void setColor(const Color& color) { m_color = color; }
|
||||
void setBackgroundColor(const Color& color) { m_backgroundColor = color; }
|
||||
void setBackgroundOffsetX(int x) { m_backgroundRect.setX(x); }
|
||||
@@ -309,7 +309,7 @@ public:
|
||||
|
||||
int getX() { return m_rect.x(); }
|
||||
int getY() { return m_rect.y(); }
|
||||
Point getPos() { return m_rect.topLeft(); }
|
||||
Point getPosition() { return m_rect.topLeft(); }
|
||||
int getWidth() { return m_rect.width(); }
|
||||
int getHeight() { return m_rect.height(); }
|
||||
Size getSize() { return m_rect.size(); }
|
||||
|
@@ -55,7 +55,7 @@ void UIWidget::parseBaseStyle(const OTMLNodePtr& styleNode)
|
||||
else if(node->tag() == "y")
|
||||
setY(node->value<int>());
|
||||
else if(node->tag() == "pos")
|
||||
setPos(node->value<Point>());
|
||||
setPosition(node->value<Point>());
|
||||
else if(node->tag() == "width")
|
||||
setWidth(node->value<int>());
|
||||
else if(node->tag() == "height")
|
||||
|
Reference in New Issue
Block a user