From 0713d7db689c1f8fce46e5534d5eaf6e97a2ed6b Mon Sep 17 00:00:00 2001 From: Faustino Kialungila Date: Tue, 7 Jan 2020 18:28:56 +0100 Subject: [PATCH] adding comments about diamond dimensions --- src/element/bounds.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/element/bounds.ts b/src/element/bounds.ts index a95d63dc2..0150f4b3e 100644 --- a/src/element/bounds.ts +++ b/src/element/bounds.ts @@ -19,6 +19,8 @@ export function getElementAbsoluteY2(element: ExcalidrawElement) { } export function getDiamondPoints(element: ExcalidrawElement) { + // Here we add +1 to avoid these numbers to be 0 + // otherwise rough.js will throw an error complaining about it const topX = Math.floor(element.width / 2) + 1; const topY = 0; const rightX = element.width;