mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-15 07:39:00 -04:00
Fix[controls]: incorrect activated overlay on rounded controls
This commit is contained in:
parent
b4a3e18b9a
commit
6e194302f5
@ -31,6 +31,9 @@ public class ControlButton extends TextView implements ControlInterface {
|
||||
protected ControlData mProperties;
|
||||
private final ControlLayout mControlLayout;
|
||||
|
||||
/* Cache value from the ControlData radius for drawing purposes */
|
||||
private float mComputedRadius;
|
||||
|
||||
protected boolean mIsToggled = false;
|
||||
protected boolean mIsPointerOutOfBounds = false;
|
||||
|
||||
@ -61,6 +64,7 @@ public class ControlButton extends TextView implements ControlInterface {
|
||||
public void setProperties(ControlData properties, boolean changePos) {
|
||||
mProperties = properties;
|
||||
ControlInterface.super.setProperties(properties, changePos);
|
||||
mComputedRadius = ControlInterface.super.computeCornerRadius(mProperties.cornerRadius);
|
||||
|
||||
if (mProperties.isToggle) {
|
||||
//For the toggle layer
|
||||
@ -85,7 +89,7 @@ public class ControlButton extends TextView implements ControlInterface {
|
||||
protected void onDraw(Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
if (mIsToggled || (!mProperties.isToggle && isActivated()))
|
||||
canvas.drawRoundRect(0, 0, getWidth(), getHeight(), mProperties.cornerRadius, mProperties.cornerRadius, mRectPaint);
|
||||
canvas.drawRoundRect(0, 0, getWidth(), getHeight(), mComputedRadius, mComputedRadius, mRectPaint);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user