makeInterpolator improvement
Closed this issue · 1 comments
mflorence99 commented
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`
.
Alex-Rafter commented
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
;