Failed to execute 'setTransform' on 'CanvasRenderingContext2D': 6 arguments required, but only 1 present.
Version
- Phaser Version: 3.70 (but tested also with 3.87)
- Operating system: Windows
- Browser: CEF (Chromium Embedded Framework): CEF 52 (default browser from Sketchup 2017)
Description
When open that browser I have an error: Uncaught TypeError: Failed to execute 'setTransform' on 'CanvasRenderingContext2D': 6 arguments required, but only 1 present.
this problem do not invoke in newest version of Sketchup Browser (like CEF 88 and above)
Example Test Code
in the config file I am using Phaser.CANVAS, because that renderer is better for my case (using phaser to visualize pdf so thin lines are necessary)
when Phaser.Auto then it is working but that renderer isn't good in my case
Additional Information
I have solved that issue by changing line
return t.setTransform(this),t}
into
return t.setTransform(this.a, this.b, this.c, this.d, this.e, this.f),t}
not sure if it is safe solution, but it's working ;P maybe in future releases you can add something like this.
ps. very very great library!!!
Hiya - how old is this device/set-up you're testing? Because setTransform has allowed you to pass a matrix object to it for years now! See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setTransform#browser_compatibility
yeees, that is pretty old browser, from 2017 probably. Using your link... Chrome (not sure if Chrominium has same numbers) support that from version 68. Unfortunately Sketchup started using Chrominium > 68 after 2021 ;/
Full situation: We are developing plugin for SketchUp (app for architects) and using phaser to have some kind of PDF viewer/editor. SketchUp has own browser based on CEF.
Of course we wish that everybody use the newest version of SketchUp, but reality is not like that :P So we try to have compatibility with old SketchUp versions like this from 2017. And that why here we have problem ;/
in worst scenario I will just update the source code each time :P
If you want to submit a PR then I don't mind reverting to the old way of doing it for the v3.88 release. This will be one of our final v3.x releases and we won't maintain this going forward for 4.x, but I don't mind doing it here.
Thanks for opening this issue, and for submitting a PR to fix it. We have merged your PR into the master branch and attributed the work to you in the Change Log. If you need to tweak the code for whatever reason please submit a new PR.