Bugfix
This commit is contained in:
parent
49b0481b83
commit
779629ed2f
|
@ -93,15 +93,19 @@ const mergeBounds = clientBounds => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const extend = function(a, b) {
|
const extend = function(a, b) {
|
||||||
a.x = Math.min(a.x, b.x);
|
const x = Math.min(a.x, b.x);
|
||||||
a.left = Math.min(a.left, b.left);
|
const left = Math.min(a.left, b.left);
|
||||||
a.width = a.width + b.width;
|
const y = Math.max(a.y, b.y);
|
||||||
a.right = Math.max(a.right + b.right);
|
const right = Math.max(a.right, b.right);
|
||||||
|
const width = a.width + b.width;
|
||||||
|
|
||||||
|
const { bottom, height, top } = a;
|
||||||
|
return { bottom, height, left, right, top, width, x, y };
|
||||||
};
|
};
|
||||||
|
|
||||||
if (previous) {
|
if (previous) {
|
||||||
if (isConsecutive(previous, bbox))
|
if (isConsecutive(previous, bbox))
|
||||||
extend(previous, bbox);
|
merged[merged.length - 1] = extend(previous, bbox);
|
||||||
else
|
else
|
||||||
merged.push(bbox);
|
merged.push(bbox);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue