mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-03 19:34:46 +00:00
Update path.class.js
Modified path positioning, fixes svg 170, debian logo, change some errors in different errors.
This commit is contained in:
parent
8294fd42ab
commit
77dd88569d
1 changed files with 9 additions and 4 deletions
|
|
@ -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]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue