Alex-Rafter/type-curve

makeInterpolator improvement

Closed this issue · 1 comments

Don't return ft.toPrecision(3); as this unnecessarily restricts the contract of makeInterpolator and makes an unwarranted assumption about what the caller is going to do with the computed font size.

Better to just return ft;. If you really wanted to truncate to 3 decimals, you should do that where it is needed, in the string interpolation `${x.toPrecision(3)}px`.

This is updated now in branch 1. Have followed the second suggestion and brought it in to the string interpolation - theGrid.style.fontSize = ${x.toPrecision(3)}px;