rendering element rewrite
This commit is contained in:
parent
4c286e1fd8
commit
3d40256bde
22 changed files with 799 additions and 795 deletions
|
|
@ -27,15 +27,20 @@ import std;
|
|||
|
||||
using namespace Crafter;
|
||||
|
||||
Transform::Transform(std::int_fast32_t anchorX, std::int_fast32_t anchorY, std::uint_fast32_t relativeWidth, std::uint_fast32_t relativeHeight, std::int_fast32_t anchorOffsetX, std::int_fast32_t anchorOffsetY, std::int_fast32_t z) : anchorX(anchorX), anchorY(anchorY), relativeWidth(relativeWidth), relativeHeight(relativeHeight), anchorOffsetX(anchorOffsetX), anchorOffsetY(anchorOffsetY), z(z) {
|
||||
|
||||
Anchor::Anchor(std::int_fast32_t x, std::int_fast32_t y, std::uint_fast32_t width, std::uint_fast32_t height, std::int_fast32_t offsetX, std::int_fast32_t offsetY, std::int_fast32_t z): x(x), y(y), width(width), height(height), offsetX(offsetX), offsetY(offsetY), z(z) {
|
||||
|
||||
}
|
||||
|
||||
Transform::Transform(Anchor anchor) : anchor(anchor) {
|
||||
|
||||
}
|
||||
|
||||
void Transform::UpdatePosition(Window& window) {
|
||||
window.ScaleElement(*this);
|
||||
for(Transform* child : children) {
|
||||
child->UpdatePosition(window, *this);
|
||||
}
|
||||
child->UpdatePosition(window, *this);
|
||||
}
|
||||
}
|
||||
|
||||
void Transform::UpdatePosition(Window& window, Transform& parent) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue