Fix lovr.graphics.getPixelDensity when widths are zero;
@@ -217,8 +217,12 @@ float lovrGraphicsGetPixelDensity() {
int width, framebufferWidth;
lovrPlatformGetWindowSize(&width, NULL);
lovrPlatformGetFramebufferSize(&framebufferWidth, NULL);
+ if (width == 0 || framebufferWidth == 0) {
+ return 0.f;
+ } else {
return (float) framebufferWidth / (float) width;
}
+}
void lovrGraphicsSetCamera(Camera* camera, bool clear) {
lovrGraphicsFlush();
