Closed dkodaj closed 5 years ago
Ok, will try!
I've committed the changes above and modified toHtml to set the element's width and height directly. Seems to work locally.
Calling this.setCanvasDimensions() instead of setCanvasDimensions() breaks it for some reason.
I don't think it works without the this.
in the caller. I'm getting this when I run it locally:
[Error] ReferenceError: Can't find variable: setCanvasDimensions
attributeChangedCallback (elm-canvas.js:45)
setAttribute
_VirtualDom_applyAttrs (ChangeOfDimensions.js:2811)
_VirtualDom_applyFacts (ChangeOfDimensions.js:2776)
_VirtualDom_render (ChangeOfDimensions.js:2748)
_VirtualDom_render (ChangeOfDimensions.js:2752)
_VirtualDom_applyPatchRedraw (ChangeOfDimensions.js:3725)
_VirtualDom_applyPatchesHelp (ChangeOfDimensions.js:3638)
(anonymous function) (ChangeOfDimensions.js:3883)
_Browser_makeAnimator (ChangeOfDimensions.js:3939)
_Platform_initialize (ChangeOfDimensions.js:1863)
Global Code (change-of-dimensions.html:11)
[Error] ReferenceError: Can't find variable: setCanvasDimensions
(anonymous function) (elm-canvas.js:37)
[Error] ReferenceError: Can't find variable: setCanvasDimensions
attributeChangedCallback (elm-canvas.js:45)
setAttribute
_VirtualDom_applyAttrs (ChangeOfDimensions.js:2811)
_VirtualDom_applyFacts (ChangeOfDimensions.js:2776)
_VirtualDom_applyPatch (ChangeOfDimensions.js:3655)
_VirtualDom_applyPatchesHelp (ChangeOfDimensions.js:3638)
(anonymous function) (ChangeOfDimensions.js:3883)
updateIfNeeded (ChangeOfDimensions.js:3947)
I'll have a look to see if I can fix it locally.
You're right, apologies. The reason it worked here (Firefox 65.0.1) had nothing to do with changes in the Canvas module or even with the observedAttributes stuff. Inded, the following small hack in connectedCallback() seemed enough:
https://ellie-app.com/4QdmfRQHMpga1
That looks more like a bug than a solution though.
I've fixed some stuff locally and merged your contribution. Thank you!
If you are interested, this are the things and fixes I did to your work: https://github.com/joakin/elm-canvas/commit/c628a917df834ae9373b52d3fd9ce8ce8654a6b6 The commit message has some info too.
I'll add your example and make some releases with the fixes.
Thanks!
On Tue, Feb 26, 2019 at 12:00 PM Joaquin notifications@github.com wrote:
I've fixed some stuff locally and merged your contribution. Thank you!
If you are interested, this are the things and fixes I did to your work: c628a91 https://github.com/joakin/elm-canvas/commit/c628a917df834ae9373b52d3fd9ce8ce8654a6b6 The commit message has some info too.
I'll add your example and make some releases with the fixes.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/joakin/elm-canvas/pull/8#issuecomment-467395039, or mute the thread https://github.com/notifications/unsubscribe-auth/AaZm_2Y_Y3jcKtmQfb3K-qDs7gyPeYmfks5vRRPQgaJpZM4bP29e .
In action: https://ellie-app.com/4PQ6ymKsHZQa1