round decimal gui rendering
This commit is contained in:
@@ -118,7 +118,17 @@ export default class Gui {
|
|||||||
static drawSprite(stack, texture, spriteX, spriteY, spriteWidth, spriteHeight, x, y, width, height, alpha = 1.0) {
|
static drawSprite(stack, texture, spriteX, spriteY, spriteWidth, spriteHeight, x, y, width, height, alpha = 1.0) {
|
||||||
stack.save();
|
stack.save();
|
||||||
stack.globalAlpha = alpha;
|
stack.globalAlpha = alpha;
|
||||||
stack.drawImage(texture, spriteX, spriteY, spriteWidth, spriteHeight, x, y, width, height);
|
stack.drawImage(
|
||||||
|
texture,
|
||||||
|
Math.floor(spriteX),
|
||||||
|
Math.floor(spriteY),
|
||||||
|
Math.floor(spriteWidth),
|
||||||
|
Math.floor(spriteHeight),
|
||||||
|
Math.floor(x),
|
||||||
|
Math.floor(y),
|
||||||
|
Math.floor(width),
|
||||||
|
Math.floor(height)
|
||||||
|
);
|
||||||
stack.restore();
|
stack.restore();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,7 @@ export default class IngameOverlay extends Gui {
|
|||||||
if (typeId !== 0) {
|
if (typeId !== 0) {
|
||||||
let renderId = "hotbar" + i;
|
let renderId = "hotbar" + i;
|
||||||
let block = Block.getById(typeId);
|
let block = Block.getById(typeId);
|
||||||
this.minecraft.itemRenderer.renderItemInGui(renderId, block, x + i * 20 + 11, y + 11);
|
this.minecraft.itemRenderer.renderItemInGui(renderId, block, Math.floor(x + i * 20 + 11), Math.floor(y + 11));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user