Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

adding comments about diamond dimensions (#241)

Faustino Kialungila846f427732b2
diff --git a/src/element/bounds.ts b/src/element/bounds.ts
index 9d83b8cecc..6a7cfcf13e 100644
--- a/src/element/bounds.ts
+++ b/src/element/bounds.ts
@@ -15,6 +15,8 @@ export function getElementAbsoluteCoords(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;