freshOS / Stevia

:leaves: Concise Autolayout code
https://freshos.github.io/SteviaDocs/
MIT License
3.38k stars 211 forks source link

Fixes Equation api + validating tests #126

Closed s4cha closed 4 years ago

s4cha commented 4 years ago

This fixes the issue described in #123, props @jsonfellin for noticing !

Equation api had bugs when using >= & <= with single values.

Before view.Width >=30view.width(>=30) view.Width >=30 was equivalent to view.Width >= Width + 30 (Wrong) view.Botton >= 100 was equivalent to view.Bottom >= Bottom + 100 (Wrong) view.Right >= 100 was equivalent to view.Right >= Right + 100 (Wrong)

Now view.Width >=30 == view.width(>=30) view.Height <=100 == view.height(<=100) view.Botton >= 100 == view.Bottom >= Bottom - 100 view.Right >= 100 == view.Right >= Right - 100