mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-01 05:08:12 +08:00
Handle intersections between two bezier curves (#735)
* Refactor intersections function * Implement intersect for quadratic and cubic bezier curves * Return t value instead of point * Change project return the t value * Add error threshold for curve intersection * Refactor to use if let statements and improve comments * Refactor intersection helper to return vector, other minor name/text changes * Rename function * Minor change * Minor fixes * Add missing test tag * Address comments * Adjust comment * Change function call * Edit comments
This commit is contained in:
@@ -59,9 +59,9 @@ export const drawText = (ctx: CanvasRenderingContext2D, text: string, x: number,
|
||||
ctx.fillText(text, x, y);
|
||||
};
|
||||
|
||||
export const drawCurve = (ctx: CanvasRenderingContext2D, points: Point[], strokeColor = COLORS.INTERACTIVE.STROKE_1): void => {
|
||||
export const drawCurve = (ctx: CanvasRenderingContext2D, points: Point[], strokeColor = COLORS.INTERACTIVE.STROKE_1, lineWidth = 2): void => {
|
||||
ctx.strokeStyle = strokeColor;
|
||||
ctx.lineWidth = 2;
|
||||
ctx.lineWidth = lineWidth;
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(points[0].x, points[0].y);
|
||||
|
||||
Reference in New Issue
Block a user