@symbolic/svgcanvas
Advanced tools
Comparing version 2.5.1 to 2.5.2
@@ -399,14 +399,17 @@ /*!! | ||
//is this a gradient or pattern? | ||
if (value instanceof CanvasPattern) { | ||
//pattern | ||
if (value.__ctx) { | ||
//copy over defs | ||
for(nodeIndex = 0; nodeIndex < value.__ctx.__defs.childNodes.length; nodeIndex++){ | ||
node = value.__ctx.__defs.childNodes[nodeIndex]; | ||
id = node.getAttribute("id"); | ||
this.__ids[id] = id; | ||
this.__defs.appendChild(node); | ||
if (value instanceof CanvasPattern || value.constructor.name === 'CanvasPattern') { | ||
if (value.image) { //MODIFIED | ||
value = this.createPattern(value.image, null); //HINT pulls in original image ref from Konva | ||
//pattern | ||
if (value.__ctx) { | ||
//copy over defs | ||
for(nodeIndex = 0; nodeIndex < value.__ctx.__defs.childNodes.length; nodeIndex++){ | ||
node = value.__ctx.__defs.childNodes[nodeIndex]; | ||
id = node.getAttribute("id"); | ||
this.__ids[id] = id; | ||
this.__defs.appendChild(node); | ||
} | ||
} | ||
currentElement.setAttribute(style.apply, format("url(#{id})", {id:value.__root.getAttribute("id")})); | ||
} | ||
currentElement.setAttribute(style.apply, format("url(#{id})", {id:value.__root.getAttribute("id")})); | ||
} | ||
@@ -413,0 +416,0 @@ else if (value instanceof CanvasGradient) { |
@@ -490,14 +490,17 @@ function toString(obj) { | ||
//is this a gradient or pattern? | ||
if (value instanceof CanvasPattern) { | ||
//pattern | ||
if (value.__ctx) { | ||
//copy over defs | ||
for(nodeIndex = 0; nodeIndex < value.__ctx.__defs.childNodes.length; nodeIndex++){ | ||
node = value.__ctx.__defs.childNodes[nodeIndex]; | ||
id = node.getAttribute("id"); | ||
this.__ids[id] = id; | ||
this.__defs.appendChild(node); | ||
if (value instanceof CanvasPattern || value.constructor.name === 'CanvasPattern') { | ||
if (value.image) { //MODIFIED | ||
value = this.createPattern(value.image, null); //HINT pulls in original image ref from Konva | ||
//pattern | ||
if (value.__ctx) { | ||
//copy over defs | ||
for(nodeIndex = 0; nodeIndex < value.__ctx.__defs.childNodes.length; nodeIndex++){ | ||
node = value.__ctx.__defs.childNodes[nodeIndex]; | ||
id = node.getAttribute("id"); | ||
this.__ids[id] = id; | ||
this.__defs.appendChild(node); | ||
} | ||
} | ||
currentElement.setAttribute(style.apply, format("url(#{id})", {id:value.__root.getAttribute("id")})); | ||
} | ||
currentElement.setAttribute(style.apply, format("url(#{id})", {id:value.__root.getAttribute("id")})); | ||
} | ||
@@ -504,0 +507,0 @@ else if (value instanceof CanvasGradient) { |
@@ -494,14 +494,17 @@ 'use strict'; | ||
//is this a gradient or pattern? | ||
if (value instanceof CanvasPattern) { | ||
//pattern | ||
if (value.__ctx) { | ||
//copy over defs | ||
for(nodeIndex = 0; nodeIndex < value.__ctx.__defs.childNodes.length; nodeIndex++){ | ||
node = value.__ctx.__defs.childNodes[nodeIndex]; | ||
id = node.getAttribute("id"); | ||
this.__ids[id] = id; | ||
this.__defs.appendChild(node); | ||
if (value instanceof CanvasPattern || value.constructor.name === 'CanvasPattern') { | ||
if (value.image) { //MODIFIED | ||
value = this.createPattern(value.image, null); //HINT pulls in original image ref from Konva | ||
//pattern | ||
if (value.__ctx) { | ||
//copy over defs | ||
for(nodeIndex = 0; nodeIndex < value.__ctx.__defs.childNodes.length; nodeIndex++){ | ||
node = value.__ctx.__defs.childNodes[nodeIndex]; | ||
id = node.getAttribute("id"); | ||
this.__ids[id] = id; | ||
this.__defs.appendChild(node); | ||
} | ||
} | ||
currentElement.setAttribute(style.apply, format("url(#{id})", {id:value.__root.getAttribute("id")})); | ||
} | ||
currentElement.setAttribute(style.apply, format("url(#{id})", {id:value.__root.getAttribute("id")})); | ||
} | ||
@@ -508,0 +511,0 @@ else if (value instanceof CanvasGradient) { |
{ | ||
"name": "@symbolic/svgcanvas", | ||
"version": "2.5.1", | ||
"version": "2.5.2", | ||
"description": "@symbolic/svgcanvas", | ||
@@ -5,0 +5,0 @@ "main": "dist/svgcanvas.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
3010239
43
36713