I'm trying to render some textures using libgdx SpriteBatch. This sounds very easy but I have a serious problem. I'm testing on desktop and depending on the resolution of the app window, textures are automatically cropped. This happens when I configure width and height attributes of LwjglApplicationConfiguration or when I just resize app window manually. Right and bottom sides of some or all of the textures are cropped depending on the resolution (maybe it depends on x,y coordinates of texture rectangles, some are shown good others are buggy). I load textures from atlas. While atlas uses MipMapLinearLinear filter, I also tested with Nearest filter, the problem still persists
Here are important parts of the code (the rest is default things taken from example like creating SpriteBatch, etc.)
// I use premultiplied alpha blending batch.enableBlending(); batch.setBlendFunction(GL20.GL_ONE, GL20.GL_ONE_MINUS_SRC_ALPHA); myAtlas = new TextureAtlas(Gdx.files.internal("test.atlas")); textureRegion = myAtlas.findRegion("testtexture"); batch.draw(textureRegion, 100, 100, 40, 40);
Here is a image below showing app windows.