Currently, the application relies on the user to produce a div with the proper styles (all child canvases are position: absolute; with top-left of 0, it is relative).
This should be moved to the JS engine where a user could choose to pass in a division similar to how THREE.JS performs its operations.
Use cases:
User provides a container div:
Layer applies position: relative; to the div
Layer checks for any child <canvas>es, applies position: absolute; top: 0; left: 0; to them
Continue workflow as normal
User provides non-container div:
Layer throws exception
User provides nothing:
Layer creates a properly styled div container and continues the workflow defined by case 1
Currently, the application relies on the user to produce a div with the proper styles (all child canvases are
position: absolute;
withtop
-left
of0
, it isrelative
).This should be moved to the JS engine where a user could choose to pass in a division similar to how THREE.JS performs its operations.
Use cases:
div
:position: relative;
to thediv
<canvas>
es, appliesposition: absolute; top: 0; left: 0;
to themdiv
: