Too lazy to make canvas dynamic right now

This commit is contained in:
2023-12-19 11:58:24 -06:00
parent aa14955924
commit 457d740c73

View File

@ -46,8 +46,8 @@ struct RenderPassContext &ctx
// data.model = this->getItem()->getWorldTransform();
data.projection = glm::ortho(
0.0f, 1280.0f,
720.0f, 0.0f,
0.0f, ctx.renderTarget->getWidth(),
ctx.renderTarget->getHeight(), 0.0f,
0.0f, 1.0f
);
data.view = glm::mat4(1.0f);
@ -66,6 +66,11 @@ struct RenderPassContext &ctx
auto self = std::ref(*this);
while(itComponents != components.end()) {
auto component = *itComponents;
component->updateAlignment(
glm::vec2(0, 0),
glm::vec2(ctx.renderTarget->getWidth(), ctx.renderTarget->getHeight()),
1.0f
);
component->getQuads(self);
++itComponents;
}
@ -136,9 +141,4 @@ void UICanvas::flushPass() {
void UICanvas::addComponent(std::shared_ptr<UIComponent> component) {
components.push_back(component);
component->updateAlignment(
glm::vec2(0, 0),
glm::vec2(1280, 720),
1.0f
);
}