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:
@@ -1625,22 +1625,18 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
if(withText){
|
if(withText){
|
||||||
Font font = Fonts.outline;
|
Font font = Fonts.outline;
|
||||||
font.setColor(col2);
|
font.setColor(col2);
|
||||||
var ints = font.usesIntegerPositions();
|
boolean ints = font.usesIntegerPositions();
|
||||||
font.setUseIntegerPositions(false);
|
font.setUseIntegerPositions(false);
|
||||||
var z = Draw.z();
|
float z = Draw.z();
|
||||||
Draw.z(Layer.endPixeled);
|
Draw.z(Layer.endPixeled);
|
||||||
font.getData().setScale(1 / renderer.camerascale);
|
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 width = (int)((result.x2 - result.x) / 8);
|
||||||
int height = (int)((result.y2 - result.y) / 8);
|
int height = (int)((result.y2 - result.y) / 8);
|
||||||
int area = width * height;
|
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 + ")",
|
font.draw(width + "x" + height + " (" + area + ")",
|
||||||
snapToCursor ? input.mouseWorldX() + textOffset * (4 / renderer.camerascale) : result.x2,
|
input.mouseWorldX() + 5 * (4 / renderer.camerascale),
|
||||||
snapToCursor ? input.mouseWorldY() - textOffset * (4 / renderer.camerascale) : result.y
|
input.mouseWorldY() - 5 * (4 / renderer.camerascale));
|
||||||
);
|
|
||||||
font.setColor(Color.white);
|
font.setColor(Color.white);
|
||||||
font.getData().setScale(1);
|
font.getData().setScale(1);
|
||||||
font.setUseIntegerPositions(ints);
|
font.setUseIntegerPositions(ints);
|
||||||
|
|||||||
Reference in New Issue
Block a user