mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
This reverts commit 16263e942b
.
This commit is contained in:
parent
16263e942b
commit
3d2e59bfed
19 changed files with 130 additions and 789 deletions
|
@ -7,7 +7,6 @@ import {
|
|||
} from "../element/bounds";
|
||||
import { RoughCanvas } from "roughjs/bin/canvas";
|
||||
import { Drawable } from "roughjs/bin/core";
|
||||
import { Point } from "roughjs/bin/geometry";
|
||||
import { RoughSVG } from "roughjs/bin/svg";
|
||||
import { RoughGenerator } from "roughjs/bin/generator";
|
||||
import { SVG_NS } from "../utils";
|
||||
|
@ -90,23 +89,18 @@ function generateElement(
|
|||
);
|
||||
break;
|
||||
case "arrow": {
|
||||
const [x2, y2, x3, y3, x4, y4] = getArrowPoints(element);
|
||||
const [x1, y1, x2, y2, x3, y3, x4, y4] = getArrowPoints(element);
|
||||
const options = {
|
||||
stroke: element.strokeColor,
|
||||
strokeWidth: element.strokeWidth,
|
||||
roughness: element.roughness,
|
||||
seed: element.seed,
|
||||
};
|
||||
// points array can be empty in the beginning, so it is important to add
|
||||
// initial position to it
|
||||
const points: Point[] = element.points.length
|
||||
? element.points
|
||||
: [[0, 0]];
|
||||
element.shape = [
|
||||
// \
|
||||
generator.line(x3, y3, x2, y2, options),
|
||||
// -----
|
||||
generator.curve(points, options),
|
||||
generator.line(x1, y1, x2, y2, options),
|
||||
// /
|
||||
generator.line(x4, y4, x2, y2, options),
|
||||
];
|
||||
|
@ -175,6 +169,7 @@ export function renderElement(
|
|||
context.fillStyle = fillStyle;
|
||||
context.font = font;
|
||||
context.globalAlpha = 1;
|
||||
break;
|
||||
} else {
|
||||
throw new Error("Unimplemented type " + element.type);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue