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