mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-17 16:47:14 -04:00
Fix buttons not being snappable when snappable
This commit is contained in:
parent
6ec0dfbbed
commit
8b0db45d02
@ -351,14 +351,14 @@ public class ControlButton extends androidx.appcompat.widget.AppCompatButton imp
|
|||||||
|
|
||||||
//Step 2: Get Coordinates
|
//Step 2: Get Coordinates
|
||||||
float button_top = button.getY();
|
float button_top = button.getY();
|
||||||
float button_bottom = button_top + button.getBottom();
|
float button_bottom = button_top + button.getHeight();
|
||||||
float button_left = button.getX();
|
float button_left = button.getX();
|
||||||
float button_right = button_left + button.getRight();
|
float button_right = button_left + button.getWidth();
|
||||||
|
|
||||||
float top = getY();
|
float top = getY();
|
||||||
float bottom = getY() + getBottom();
|
float bottom = getY() + getHeight();
|
||||||
float left = getX();
|
float left = getX();
|
||||||
float right = getX() + getRight();
|
float right = getX() + getWidth();
|
||||||
|
|
||||||
//Step 3: For each axis, we try to snap to the nearest
|
//Step 3: For each axis, we try to snap to the nearest
|
||||||
if(Math.abs(top - button_bottom) < MIN_DISTANCE){ // Bottom snap
|
if(Math.abs(top - button_bottom) < MIN_DISTANCE){ // Bottom snap
|
||||||
|
Loading…
x
Reference in New Issue
Block a user