Merge remote-tracking branch 'remotes/origin/stable-1.2.2' into js2gcode
This commit is contained in:
commit
ea591a954e
2 changed files with 11 additions and 4 deletions
|
|
@ -70,12 +70,14 @@ Snap.plugin(function (Snap, Element, Paper, global) {
|
|||
|
||||
// Validity checks from http://www.w3.org/TR/SVG/shapes.html#RectElement:
|
||||
// If 'x' and 'y' are not specified, then set both to 0. // CorelDraw is creating that sometimes
|
||||
if (!isFinite(x))
|
||||
if (!isFinite(x)) {
|
||||
console.log('No attribute "x" in image tag. Assuming 0.')
|
||||
x = 0;
|
||||
if (!isFinite(y))
|
||||
}
|
||||
if (!isFinite(y)) {
|
||||
console.log('No attribute "y" in image tag. Assuming 0.')
|
||||
y = 0;
|
||||
}
|
||||
var transform = elem.transform();
|
||||
var matrix = transform['totalMatrix'];
|
||||
var transformedX = matrix.x(x, y);
|
||||
|
|
|
|||
|
|
@ -347,7 +347,7 @@ $(function(){
|
|||
dx = -svgBB.x + 0.01;
|
||||
outside = true;
|
||||
} else if(svgBB.x2 > waBB.x2){
|
||||
dx = -svgBB.x2 + waBB.x2 - 0.01;
|
||||
dx = -svgBB.x + 0.01;
|
||||
outside = true;
|
||||
}
|
||||
if(svgBB.y < waBB.y){
|
||||
|
|
@ -760,7 +760,12 @@ $(function(){
|
|||
self._embedAllImages = function(svg, callback){
|
||||
|
||||
var allImages = svg.selectAll('image');
|
||||
var linkedImages = allImages.items.filter(function(i){ return !i.attr('href').startsWith('data:') });
|
||||
var linkedImages = allImages.items.filter(function(i){
|
||||
if(i.attr('xlink:href') != null) {
|
||||
return !i.attr('xlink:href').startsWith('data:');
|
||||
} else if(i.attr('href') != null) {
|
||||
return !i.attr('href').startsWith('data:');
|
||||
}});
|
||||
if(linkedImages.length > 0){
|
||||
var callbackCounter = linkedImages.length;
|
||||
for (var i = 0; i < linkedImages.length; i++) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue