fix calc diamond bounds (#1394)

This commit is contained in:
Daishi Kato 2020-04-12 10:19:01 +09:00 committed by GitHub
parent e98fba38be
commit 038cff8793
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -288,7 +288,7 @@ export const getElementBounds = (
if (element.type === "diamond") { if (element.type === "diamond") {
const [x11, y11] = rotate(cx, y1, cx, cy, element.angle); const [x11, y11] = rotate(cx, y1, cx, cy, element.angle);
const [x12, y12] = rotate(cx, y2, cx, cy, element.angle); const [x12, y12] = rotate(cx, y2, cx, cy, element.angle);
const [x22, y22] = rotate(x2, cy, cx, cy, element.angle); const [x22, y22] = rotate(x1, cy, cx, cy, element.angle);
const [x21, y21] = rotate(x2, cy, cx, cy, element.angle); const [x21, y21] = rotate(x2, cy, cx, cy, element.angle);
const minX = Math.min(x11, x12, x22, x21); const minX = Math.min(x11, x12, x22, x21);
const minY = Math.min(y11, y12, y22, y21); const minY = Math.min(y11, y12, y22, y21);