feat: sync element's width and height to context
This commit is contained in:
parent
134e9c52cb
commit
3e7435eec8
@ -28,6 +28,10 @@ const mySerializedSVG = ctx.getSerializedSvg();
|
||||
|
||||
## CHANGELOG
|
||||
|
||||
### v2.0.3
|
||||
|
||||
- feat: sync element's width and height to context
|
||||
|
||||
### v2.0.2
|
||||
|
||||
- feat: Implement CanvasTransform Interface, https://github.com/gliffy/canvas2svg/pull/83
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*!!
|
||||
* SVGCanvas v2.0.1
|
||||
* SVGCanvas v2.0.3
|
||||
* Draw on SVG using Canvas's 2D Context API.
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
|
@ -2,9 +2,7 @@ import Context from './context';
|
||||
|
||||
function SVGCanvasElement(options) {
|
||||
|
||||
var debug = options && options.debug;
|
||||
|
||||
this.ctx = new Context(100, 100, {debug: debug});
|
||||
this.ctx = new Context(100, 100);
|
||||
this.svg = this.ctx.__root;
|
||||
|
||||
// sync attributes to svg
|
||||
@ -34,7 +32,7 @@ function SVGCanvasElement(options) {
|
||||
if (isNaN(val) || (typeof val === "undefined")) {
|
||||
return;
|
||||
}
|
||||
_this.ctx['__'+prop] = val;
|
||||
_this.ctx[prop] = val;
|
||||
svg.setAttribute(prop, val);
|
||||
return wrapper[prop] = val;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user