Moving normalizeBBox to util.js
This commit is contained in:
1 parent
abb5838113
commit
870b2e6ed4
5 files changed
+40
-36
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { customEvent } from '../../util.js';
|
||||
import { customEvent, normalizeBBox } from '../../util.js';
|
||||
import _ from 'lodash';
|
||||
import Q from 'q';
|
||||
|
||||
@@ -54,14 +54,6 @@ export default class Node {
|
||||
return _.extend(this.container.getBBox(), this.anchor);
|
||||
}
|
||||
|
||||
normalizeBBox(box) {
|
||||
return _.extend({
|
||||
ax: box.x,
|
||||
ax2: box.x2,
|
||||
ay: box.cy
|
||||
}, box);
|
||||
}
|
||||
|
||||
transform(matrix) {
|
||||
return this.container.transform(matrix);
|
||||
}
|
||||
@@ -150,14 +142,14 @@ export default class Node {
|
||||
item.transform(Snap.matrix()
|
||||
.translate(offset, 0));
|
||||
|
||||
box = this.normalizeBBox(item.getBBox());
|
||||
box = normalizeBBox(item.getBBox());
|
||||
verticalCenter = Math.max(verticalCenter, box.ay);
|
||||
|
||||
return offset + options.padding + box.width;
|
||||
}, 0);
|
||||
|
||||
for (var item of items) {
|
||||
let box = this.normalizeBBox(item.getBBox());
|
||||
let box = normalizeBBox(item.getBBox());
|
||||
|
||||
item.transform(Snap.matrix()
|
||||
.add(item.transform().localMatrix)
|
||||
|
||||
Reference in new issue
Block a user