itch.io is community of indie game creators and players

Devlogs

Fixed chart resizing on window-resize

Stickers And Stamps
A browser Map Story made in HTML5

The libraries I've been using on this project do some nice tricks...like resizing the "chapter" panels (divs) when the browser window resizes.

That's cool, but I've written my code so that I'm appending chart divs to specific chapter divs.  And these were not resizing with the rest of the panels. Most people might not notice, but it was looking sloppy to me.  And, if you launch the project as full screen after opening it from the project page (instead of "downloading" it), it's always noticeable ,

Here are some screenshots, showing the not-resized chart divs.


To solve this problem, I've wrapped the original resize function in a slightly more complicated function. Now, when the window is resized, the original function is called before my chart-resize code runs.

Files

  • v1_02.zip 2 MB
    Aug 20, 2022
Download Stickers And Stamps