mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-05 20:34:45 +00:00
fabric.Rect.fromElement() are wrong positioned
If the left/top properties are 0 they are ignored - they are not normalized. http://jsfiddle.net/Kienz/3SmUC
This commit is contained in:
parent
a0bc7b6904
commit
185686738e
1 changed files with 2 additions and 2 deletions
|
|
@ -206,11 +206,11 @@
|
|||
* Since coordinate system differs from that of SVG
|
||||
*/
|
||||
_normalizeLeftTopProperties: function(parsedAttributes) {
|
||||
if (parsedAttributes.left) {
|
||||
if ('left' in parsedAttributes) {
|
||||
this.set('left', parsedAttributes.left + this.getWidth() / 2);
|
||||
}
|
||||
this.set('x', parsedAttributes.left || 0);
|
||||
if (parsedAttributes.top) {
|
||||
if ('top' in parsedAttributes) {
|
||||
this.set('top', parsedAttributes.top + this.getHeight() / 2);
|
||||
}
|
||||
this.set('y', parsedAttributes.top || 0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue