1
0
forked from Clones/Controlify

improve controller snapping

This commit is contained in:
isXander
2023-02-13 22:13:11 +00:00
parent 80c445b5a5
commit f1ba413f62
4 changed files with 19 additions and 16 deletions

View File

@ -31,7 +31,7 @@ public abstract class AbstractContainerScreenMixin<T extends AbstractContainerMe
@Override
public Set<SnapPoint> getSnapPoints() {
return getMenu().slots.stream()
.map(slot -> new SnapPoint(new Vector2i(leftPos + slot.x + 8, topPos + slot.y + 8), 24))
.map(slot -> new SnapPoint(new Vector2i(leftPos + slot.x + 8, topPos + slot.y + 8), 14))
.collect(Collectors.toSet());
}
}

View File

@ -31,7 +31,7 @@ public abstract class CreativeModeInventoryScreenMixin extends AbstractContainer
int x = leftPos + getTabX(tab);
int y = topPos + (topRow ? -28 : imageHeight - 4);
points.add(new SnapPoint(new Vector2i(x + 13, y + 16), 38));
points.add(new SnapPoint(new Vector2i(x + 13, y + 16), 18));
}
if (canScroll()) {

View File

@ -24,7 +24,7 @@ public abstract class ScreenMixin implements ISnapBehaviour {
.map(AbstractWidget.class::cast)
.map(widget -> new SnapPoint(
new Vector2i(widget.getX() + widget.getWidth() / 2, widget.getY() + widget.getHeight() / 2),
Math.min(widget.getWidth(), widget.getHeight()) + 5
Math.min(widget.getWidth(), widget.getHeight()) / 2 + 10
))
.collect(Collectors.toSet());
}