unconed / MathBox.js

MathBox is a (work in progress) library for making presentation-quality math diagrams in WebGL.
MIT License
1.94k stars 126 forks source link

labels don't take scale into account #4

Open greggman opened 11 years ago

greggman commented 11 years ago

Go into examples/Axis.html and at line 32 set scale to 2 then view the page. It seems like all of the labels need to have their screen position multiplied by scale? I'm not sure where to do that. Seems like some where around line 6854 but I'm not sure how to access the scale value at that point.

Note that if you set set scale to

scale: window.devicePixelRatio ? (1 / window.devicePixelRatio) : 1

Then you'll get high res renderings on HD-DPI displays. Of course you might want an option to change the line thicknesses by the scale factor as well? Although I think it looks good as is with thinner lines on HD-DPI.

Maybe there's already a way to make it handle HD-DPI I'm not aware of?