We can have it both ways

- Fix scroll handler for schematics and schematic and quill swallowing
  values close to zero
- Similar issue to the elevator controls from a few months ago, not sure
  if it's just my mouse
This commit is contained in:
Jozufozu 2025-02-08 17:25:59 -08:00
parent 99cf19dd5d
commit 04fc795859
2 changed files with 7 additions and 4 deletions

View file

@ -63,9 +63,12 @@ public class SchematicAndQuillHandler {
if (bb.contains(projectedView)) if (bb.contains(projectedView))
delta *= -1; delta *= -1;
int x = (int) (vec.getX() * delta); // Round away from zero to avoid an implicit floor
int y = (int) (vec.getY() * delta); int intDelta = (int) (delta > 0 ? Math.ceil(delta) : Math.floor(delta));
int z = (int) (vec.getZ() * delta);
int x = vec.getX() * intDelta;
int y = vec.getY() * intDelta;
int z = vec.getZ() * intDelta;
AxisDirection axisDirection = selectedFace.getAxisDirection(); AxisDirection axisDirection = selectedFace.getAxisDirection();
if (axisDirection == AxisDirection.NEGATIVE) if (axisDirection == AxisDirection.NEGATIVE)

View file

@ -320,7 +320,7 @@ public class SchematicHandler implements IGuiOverlay {
return false; return false;
if (selectionScreen.focused) { if (selectionScreen.focused) {
selectionScreen.cycle((int) delta); selectionScreen.cycle((int) Math.signum(delta));
return true; return true;
} }
if (AllKeys.ctrlDown()) if (AllKeys.ctrlDown())