Xacus / demonlord

Shadow of the Demonlord for FoundryVTT.
28 stars 22 forks source link

Game does not load on FireFox due to malformed svgs #132

Closed natis1 closed 1 year ago

natis1 commented 1 year ago

On FireFox, scenes will load to around 96% before getting stuck.

Opening the console shows the error: "Uncaught Error: The SVG image must have width and height defined (in pixels), canvas API needs them." This appears to be a requirement enforced by PixiJS which Foundry uses as its backend. As far as they're concerned SVGs that don't explicitly specify height and width are malformed: https://github.com/pixijs/pixijs/issues/7877#issuecomment-1172083243

"we don't think Pixi should be handling invalid data...especially when it adds a lot of complexity to the SVGResource"

Per Foundry's minimum requirements, Firefox is listed as a compatible "modern web browser." Additionally this issue does not affect any other foundry systems to my knowledge.

The problem seems to be the SVGs are using style="height: Ypx; width: Xpx" and should be using height="Y" width="X"

juanferrer commented 1 year ago

I'll try this fix.