Clamp pixelator FBO size

This commit is contained in:
Anuken
2021-10-26 09:52:02 -04:00
parent b6acf1af0a
commit 860e4a2999
2 changed files with 4 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import arc.graphics.*;
import arc.graphics.Texture.*;
import arc.graphics.g2d.*;
import arc.graphics.gl.*;
import arc.math.*;
import arc.util.*;
import static arc.Core.*;
@@ -35,6 +36,8 @@ public class Pixelator implements Disposable{
w = (int)(Core.camera.width * renderer.landScale() / renderer.getScale());
h = (int)(Core.camera.height * renderer.landScale() / renderer.getScale());
}
w = Mathf.clamp(w, 2, graphics.getWidth());
h = Mathf.clamp(h, 2, graphics.getHeight());
buffer.resize(w, h);