elmesque
elmesque copied to clipboard
Force text position to round to the nearest integer before drawing.
If text is placed at a fractional position (i.e. [30.3, 20.5] instead of [30.0, 20.0]) it causes artefacts to appear and a slight warping when drawn.
@bvssvni is there maybe a way we can "round" or "floor" the transform position to the nearest whole number position just before drawing text (perhaps somewhere around here)?
Normally i've been avoiding this by making sure that whenever I .shift a text Form I use .floored or .rounded values, however this becomes too hard to keep track of when shifting groups of groups of Forms for example. It would be nice if the user didn't have to think about it and the backend handled it automatically.
Could add Text::roundto piston-graphics, which rounds the translated position.
I opened https://github.com/PistonDevelopers/graphics/issues/998
oooo that sounds good :+1: would be interesting to see if it fixes all the text artefacts issues in conrod :)
Just for fun, a related slide that describes our issue pretty nicely. I guess what we're doing by .floor/.rounding the position is converting to a Signed Distance Field.