Add snap/align support for new variables.

This commit is contained in:
SerpentSpirale 2021-07-30 17:28:16 +02:00 committed by ArtDev
parent ba01daae1a
commit 4a48cbd249

View File

@ -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){