improve lozenge dimensions (#197)

This commit is contained in:
Faustino Kialungila 2020-01-06 09:08:09 +01:00 committed by GitHub
parent ea534dd535
commit b3667000e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -742,10 +742,10 @@ function getArrowPoints(element: ExcalidrawElement) {
} }
function getDiamondPoints(element: ExcalidrawElement) { function getDiamondPoints(element: ExcalidrawElement) {
const topX = Math.PI + element.width / 2; const topX = Math.floor(element.width / 2) + 1;
const topY = element.height - element.height; const topY = 0;
const rightX = element.width; const rightX = element.width;
const rightY = Math.PI + element.height / 2; const rightY = Math.floor(element.height / 2) + 1;
const bottomX = topX; const bottomX = topX;
const bottomY = element.height; const bottomY = element.height;
const leftX = topY; const leftX = topY;
@ -797,7 +797,12 @@ function generateDraw(element: ExcalidrawElement) {
leftY leftY
] = getDiamondPoints(element); ] = getDiamondPoints(element);
return generator.polygon( return generator.polygon(
[[topX, topY], [rightX, rightY], [bottomX, bottomY], [leftX, leftY]], [
[topX, topY],
[rightX, rightY],
[bottomX, bottomY],
[leftX, leftY]
],
{ {
stroke: element.strokeColor, stroke: element.strokeColor,
fill: element.backgroundColor, fill: element.backgroundColor,
@ -1186,6 +1191,7 @@ function ButtonSelect<T>({
<div className="buttonList"> <div className="buttonList">
{options.map(option => ( {options.map(option => (
<button <button
key={option.text}
onClick={() => onChange(option.value)} onClick={() => onChange(option.value)}
className={value === option.value ? "active" : ""} className={value === option.value ? "active" : ""}
> >