fix: snap nametag screen coordinates to pixel grid to eliminate jitter

This commit is contained in:
xiaozhou233 committed 2026-08-24 03:17:31 +08:00
1 parent fa31cb8a67
commit 2ebe7fd19c
1 file changed
+2 -2
@@ -79,8 +79,8 @@ public class NameTag extends Module {
if (screenZ >= 1.0f) continue;
int scaleFactor = new ScaledResolution(mc).getScaleFactor();
float screenX = screenCoords.get(0) / scaleFactor;
float screenY = (mc.displayHeight - screenCoords.get(1)) / scaleFactor;
float screenX = (float) Math.floor(screenCoords.get(0) / scaleFactor);
float screenY = (float) Math.floor((mc.displayHeight - screenCoords.get(1)) / scaleFactor);
String name = player.getDisplayName().getFormattedText();
String healthText = "";