adding comments about diamond dimensions (#241)

This commit is contained in:
Faustino Kialungila 2020-01-07 18:59:10 +01:00 committed by David Luzar
parent 10955f8bb0
commit 846f427732

View File

@ -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;