fix window yoga framebuffer resize bug
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2025-05-13 14:52:27 -04:00
parent 7c9c15ff05
commit 03baa714d8
2 changed files with 9 additions and 0 deletions

View File

@ -1749,6 +1749,7 @@ Fix server life tree missing nullcheck
Inventory interaction type Inventory interaction type
Debug ui for natural inventory on entity view Debug ui for natural inventory on entity view
Can open ui menu to view inventories of other entities on client Can open ui menu to view inventories of other entities on client
Fix windows not resizing internal framebuffer when yoga changes their dimensions

View File

@ -452,6 +452,14 @@ public class Window implements DrawableElement, ContainerElement, NavigableEleme
float topRaw = Yoga.YGNodeLayoutGetTop(yogaNode); float topRaw = Yoga.YGNodeLayoutGetTop(yogaNode);
float widthRaw = Yoga.YGNodeLayoutGetWidth(yogaNode); float widthRaw = Yoga.YGNodeLayoutGetWidth(yogaNode);
float heightRaw = Yoga.YGNodeLayoutGetHeight(yogaNode); float heightRaw = Yoga.YGNodeLayoutGetHeight(yogaNode);
if(this.width != (int)widthRaw || this.height != (int)heightRaw){
try {
widgetBuffer.free();
widgetBuffer = FramebufferUtils.generateTextureFramebuffer(Globals.renderingEngine.getOpenGLState(), (int)widthRaw, (int)heightRaw);
} catch(Exception e){
LoggerInterface.loggerRenderer.ERROR(e);
}
}
//apply the values to this component //apply the values to this component
this.absoluteX = (int)leftRaw; this.absoluteX = (int)leftRaw;
this.absoluteY = (int)topRaw; this.absoluteY = (int)topRaw;