Update path.class.js

Modified path positioning, fixes svg 170, debian logo, change some errors in different errors.
This commit is contained in:
asturur 2014-06-21 17:03:54 +02:00
parent 8294fd42ab
commit 77dd88569d

View file

@ -129,11 +129,13 @@
}
else { //Set center location relative to given height/width if not specified
if (!isTopSet) {
this.top = this.height / 2;
this.top = 0;
}
this.top -= this.height / 2;
if (!isLeftSet) {
this.left = this.width / 2;
this.left = 0;
}
this.left -= this.width / 2;
}
this.pathOffset = this.pathOffset ||
// Save top-left coords as offset
@ -146,8 +148,8 @@
*/
_calculatePathOffset: function (origLeft, origTop) {
return {
x: this.left - origLeft - (this.width / 2),
y: this.top - origTop - (this.height / 2)
x: this.left - origLeft,
y: this.top - origTop
};
},
@ -452,6 +454,9 @@
if (!this.visible) return;
ctx.save();
if (noTransform) {
ctx.translate(this.left, this.top);
}
var m = this.transformMatrix;
if (m) {
ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);