cashapp / contour

Layouts with lambdas 😎
Apache License 2.0
1.53k stars 50 forks source link

Introduce XFloat.toInt() and YFloat.toInt() #103

Closed saket closed 4 years ago

saket commented 4 years ago

We've got some axis solvers that accept both Ints and Floats but for others, converting floats manually is verbose:

XInt((name.width() * 0.3f).value.toInt())

This PR adds toInt() functions to make the conversion slightly nicer:

(name.width() * 0.3f).toInt()
JakeWharton commented 4 years ago

Simple test?