mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-15 07:39:00 -04:00
Add snap/align support for new variables.
This commit is contained in:
parent
ba01daae1a
commit
4a48cbd249
@ -440,8 +440,11 @@ public class ControlButton extends androidx.appcompat.widget.AppCompatButton imp
|
||||
* @return
|
||||
*/
|
||||
private static String applySize(String equation, ControlButton button){
|
||||
return equation.replace("${height}", " px(" + Tools.pxToDp(button.getProperties().getHeight()) + ") /" + PREF_BUTTONSIZE + " * ${preferred_scale}")
|
||||
.replace("${width}", " px(" + Tools.pxToDp(button.getProperties().getWidth()) + ") / " + PREF_BUTTONSIZE + " * ${preferred_scale}");
|
||||
return equation
|
||||
.replace("${right}", "(${screen_width} - ${width})")
|
||||
.replace("${bottom}","(${screen_height} - ${height})")
|
||||
.replace("${height}", "(px(" + Tools.pxToDp(button.getProperties().getHeight()) + ") /" + PREF_BUTTONSIZE + " * ${preferred_scale})")
|
||||
.replace("${width}", "(px(" + Tools.pxToDp(button.getProperties().getWidth()) + ") / " + PREF_BUTTONSIZE + " * ${preferred_scale})");
|
||||
}
|
||||
|
||||
public int computeStrokeWidth(float widthInPercent){
|
||||
|
Loading…
x
Reference in New Issue
Block a user