Closed DreiDe closed 3 months ago
by default valToPos()
works in css/logical pixels that you would use for cursor/dom positioning. if you want this properly scaled to canvas pixels you have to call it with true
for the third arg:
@leeoniya Thanks for the quick support. This makes totally sense and fixed the problem. I wasn't aware that CSS pixels and Canvas pixels deviate when the browser window is scaled. I really appreciate your help :relieved:
When using
valToPos()
inside thedrawClear
hook, and plotting e.g. a line withu.ctx.lineTo
the resulting line is offset to the left and to the top when the browser window is zoomed in. The plot itself however is drawn correctly. Is there some internal logic for handling this?