소스 검색

adding comments about diamond dimensions (#241)

Faustino Kialungila 5 년 전
부모
커밋
846f427732
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      src/element/bounds.ts

+ 2 - 0
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;