mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
adding comments about diamond dimensions (#241)
This commit is contained in:
parent
10955f8bb0
commit
846f427732
1 changed files with 2 additions and 0 deletions
|
@ -15,6 +15,8 @@ export function getElementAbsoluteCoords(element: ExcalidrawElement) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getDiamondPoints(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 topX = Math.floor(element.width / 2) + 1;
|
||||||
const topY = 0;
|
const topY = 0;
|
||||||
const rightX = element.width;
|
const rightX = element.width;
|
||||||
|
|
Loading…
Add table
Reference in a new issue