Fixed Book ElementImage calling the wrong blit (added custom blit)

This commit is contained in:
Arthur Uzulin committed 2019-09-30 01:57:08 +10:00
1 parent 27fc2e66c9
commit f8a840984d
1 file changed
+5 -1
@@ -64,7 +64,7 @@ public class ElementImage extends SizedBookElement {
if (this.image.item == null) {
this.renderEngine.bindTexture(this.image.location);
blit(this.x, this.y, this.image.u, this.image.v, this.image.uw, this.image.vh, this.width, this.height, this.image.texWidth, this.image.texHeight);
blitRaw(x, y, width, height, image.u, image.u + image.uw, image.v, image.v + image.vh, image.texWidth, image.texHeight);
}
else {
GlStateManager.pushMatrix();
@@ -75,4 +75,8 @@ public class ElementImage extends SizedBookElement {
GlStateManager.popMatrix();
}
}
public static void blitRaw(int x, int y, int w, int h, int minU, int maxU, int minV, int maxV, float tw, float th) {
innerBlit(x, x + w, y, y + h, 0, minU / tw, maxU / tw, minV / th, maxV / th);
}
}