Canvas css margin issue
Hi Eric,
There is an issue with the canvas css margin. Everything drawn in the canvas will lost its position if u set a css margin to the canvas.
Take a look : http://jsfiddle.net/v1r00z/RNLxb/15/ try to click or drag the shape from the top area left to the shape.
don't do that! I may need to hardcode styles inside the canvas tags so that people's canvas styles don't interfere with the stage DOM.
This problem isn't unique to KineticJS, but any widget from any library. If users override widget CSS styling, the widget UI may be compromised.
On second thought, I'll go ahead and hardcode positional styles (e.g. margins, padding, display, position, etc) and hook those changes into this issue.
Thanks!
Thanks, adding a hook for this will be awesome!
so new canvases will now be have inline position, width, height, margin, border, padding, and background defaults. Anything other styles we should worry about?
fixed:
https://github.com/ericdrowell/KineticJS/commit/ca0d3790b287f3dec2a76fd3a3c948d37a12bf3f
Great! Nothing else as far as I know.
Hey, can we re-open this issue? Hardcoded width and heights break responsive layouts. It'd be great if we could disable default styles so we can write our own without having to do overrides.