I'm using Swiffy to render onto a hidden canvas so that I can take the result and use it elsewhere. The problem I'm running into is that when I resize the container div for Swiffy it won't make the actual canvas any bigger than the available viewport size. If I set the dimensions of the Swiffy div larger than the viewport then the canvas will only get as big as the viewport - it doesn't want to put any part of the canvas offscreen.
I'm sure this is for efficiency, there's no reason to render something if it's offscreen normally, but I need to have Swiffy render it all the time, at whatever size I want.
Additionally, Swiffy just plain refuses to do anything if the Swiffy container div isn't attached to the DOM. (Forces the canvas to have a width and height of 0).
Is there a way around this without having to dig into the (obfuscated) Swiffy client runtime and modify it? How can I trick Swiffy into rendering larger than the viewport size?
Edit: I was actually able to trick swiffy into rendering larger than the viewport by changing window.innerWidth to whatever I want. That's a really ugly hack though and I hate to overwrite that as it causes a lot of issues.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…