mirror of https://github.com/bjornbytes/lovr.git
Fix lovr.graphics.getPixelDensity when widths are zero;
This commit is contained in:
parent
6f20126020
commit
d12d185e6c
|
@ -217,7 +217,11 @@ float lovrGraphicsGetPixelDensity() {
|
|||
int width, framebufferWidth;
|
||||
lovrPlatformGetWindowSize(&width, NULL);
|
||||
lovrPlatformGetFramebufferSize(&framebufferWidth, NULL);
|
||||
return (float) framebufferWidth / (float) width;
|
||||
if (width == 0 || framebufferWidth == 0) {
|
||||
return 0.f;
|
||||
} else {
|
||||
return (float) framebufferWidth / (float) width;
|
||||
}
|
||||
}
|
||||
|
||||
void lovrGraphicsSetCamera(Camera* camera, bool clear) {
|
||||
|
|
Loading…
Reference in New Issue