NaN fix
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2024-09-02 10:48:48 -04:00
parent ee3d31abe1
commit a7164a5084
3 changed files with 13 additions and 1 deletions

View File

@ -448,7 +448,7 @@
<version>2.22.2</version>
<configuration>
<!--If you want the logs to throw exceptions on opengl errors, remove the "n" after .jar=t-->
<argLine>-javaagent:./lwjglx-debug-1.0.0.jar=tn;o=trace.log</argLine>
<argLine>-javaagent:./lwjglx-debug-1.0.0.jar=t;o=trace.log</argLine>
</configuration>
</plugin>
</plugins>

View File

@ -136,7 +136,13 @@ public class BitmapCharacter extends StandardElement implements DrawableElement
this.internalPositionX = (int)leftRaw;
this.internalPositionY = (int)topRaw;
this.internalWidth = (int)Yoga.YGNodeLayoutGetWidth(yogaNode);
if(!Float.isFinite(this.internalWidth)){
this.internalWidth = 0;
}
this.internalHeight = (int)Yoga.YGNodeLayoutGetHeight(yogaNode);
if(!Float.isFinite(this.internalHeight)){
this.internalHeight = 0;
}
//calculate absolute values
if(!useAbsolutePosition){
this.absoluteX = parentX + internalPositionX;

View File

@ -252,7 +252,13 @@ public class StandardContainerElement extends StandardElement implements Contain
float leftRaw = Yoga.YGNodeLayoutGetLeft(yogaNode);
float topRaw = Yoga.YGNodeLayoutGetTop(yogaNode);
float widthRaw = Yoga.YGNodeLayoutGetWidth(yogaNode);
if(!Float.isFinite(widthRaw)){
widthRaw = 0;
}
float heightRaw = Yoga.YGNodeLayoutGetHeight(yogaNode);
if(!Float.isFinite(heightRaw)){
heightRaw = 0;
}
LoggerInterface.loggerUI.DEBUG("" + this);
LoggerInterface.loggerUI.DEBUG("pos(" + leftRaw + "," + topRaw + ") dim(" + widthRaw + "," + heightRaw + ")");
//apply the values to this component