box-annotations 4.1.1-beta.0 → 4.1.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -67,6 +67,12 @@ export default class HighlightCanvas extends React.PureComponent<Props> {
|
|
|
67
67
|
|
|
68
68
|
shapesArray.forEach(rect => {
|
|
69
69
|
const { height, isActive, isHover, width, x, y } = rect;
|
|
70
|
+
|
|
71
|
+
// Ignore empty rects with a width or height of 0
|
|
72
|
+
if (width === 0 || height === 0) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
70
76
|
const rectHeight = (height / 100) * canvasHeight;
|
|
71
77
|
const rectWidth = (width / 100) * canvasWidth;
|
|
72
78
|
const x1 = (x / 100) * canvasWidth;
|
|
@@ -103,6 +103,12 @@ export const combineRects = (rects: Shape[]): Shape[] => {
|
|
|
103
103
|
|
|
104
104
|
dedupeRects(rects).forEach(rect => {
|
|
105
105
|
const { height, width, x, y } = rect;
|
|
106
|
+
|
|
107
|
+
// Ignore empty rects with a width or height of 0
|
|
108
|
+
if (width === 0 || height === 0) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
|
|
106
112
|
const lastRect = result.pop();
|
|
107
113
|
|
|
108
114
|
if (!lastRect) {
|