You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: we have text with font-size from fitty. When the user tries to print the page, the page size changes, but fitty does not update.
I tried calling fit() on the beforeprint event, but that didn't help. The font-size still didn't update.
I then understood that fitty does its calculations and updates asynchronously in a requestAnimationFrame call. For the layout changes to be effective in the print layout, they need to be done synchronously inside the beforeprint event handler.
Proposed solutions:
provide a way to make the calculations and updates synchronously fitSync() method?
provide an observePrint option, much like the existing observeWindow, that listens to the beforeprint event and recalculates synchronously
The text was updated successfully, but these errors were encountered:
@miguelcobain appreciate the thorough ticket, and PR. 🙏
I like introducing a sync option better as it doesn't pull in additional specific functionality and is thus more flexibly towards future situations that might also require sync redraw.
Problem: we have text with font-size from fitty. When the user tries to print the page, the page size changes, but fitty does not update.
I tried calling
fit()
on thebeforeprint
event, but that didn't help. The font-size still didn't update.I then understood that fitty does its calculations and updates asynchronously in a
requestAnimationFrame
call. For the layout changes to be effective in the print layout, they need to be done synchronously inside thebeforeprint
event handler.Proposed solutions:
fitSync()
method?observePrint
option, much like the existingobserveWindow
, that listens to thebeforeprint
event and recalculates synchronouslyThe text was updated successfully, but these errors were encountered: