stefan-hoeck / idris2-dom-mvc

Single Page Web Applications in Idris
BSD 3-Clause "New" or "Revised" License
19 stars 2 forks source link

[ refactor ] provide a pure way to work with TextMetrics #68

Closed stefan-hoeck closed 7 months ago

stefan-hoeck commented 7 months ago

Computing TextMetrics is the only way to get the correct size of a piece of text in the canvas. So far, we used a clumsy hack to make text metrics available to client code. With this PR, we still use a hack (in form of an auto-implicit utility for computing text metrics, which is derived from CanvasRenderingContext2D), but it's far less clumsy.