Bugfix: selection size area text on mobile (#11590)

* I m blaming foos devs for my all mistakes and problems and global warming and the price of housing

* STOP IMPORTING RANDOM CLASSES VSCODE

* huh
This commit is contained in:
EggleEgg
2026-02-04 19:55:16 +01:00
committed by GitHub
parent 89e89efac6
commit 3e0aafea36

View File

@@ -1625,22 +1625,18 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
if(withText){
Font font = Fonts.outline;
font.setColor(col2);
var ints = font.usesIntegerPositions();
boolean ints = font.usesIntegerPositions();
font.setUseIntegerPositions(false);
var z = Draw.z();
float z = Draw.z();
Draw.z(Layer.endPixeled);
font.getData().setScale(1 / renderer.camerascale);
var snapToCursor = Core.settings.getBool("selectionsizeoncursor");
var textOffset = Core.settings.getInt("selectionsizeoncursoroffset", 5);
int width = (int)((result.x2 - result.x) / 8);
int height = (int)((result.y2 - result.y) / 8);
int area = width * height;
// FINISHME: When not snapping to cursor, perhaps it would be best to choose the corner closest to the cursor that's at least a block away?
font.draw(width + "x" + height + " (" + area + ")",
snapToCursor ? input.mouseWorldX() + textOffset * (4 / renderer.camerascale) : result.x2,
snapToCursor ? input.mouseWorldY() - textOffset * (4 / renderer.camerascale) : result.y
);
input.mouseWorldX() + 5 * (4 / renderer.camerascale),
input.mouseWorldY() - 5 * (4 / renderer.camerascale));
font.setColor(Color.white);
font.getData().setScale(1);
font.setUseIntegerPositions(ints);