Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster selection / erasing #3454

Merged
merged 9 commits into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions apps/examples/src/examples/exploded/ExplodedExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
DefaultContextMenuContent,
TldrawEditor,
TldrawHandles,
TldrawHoveredShapeIndicator,
TldrawScribble,
TldrawSelectionBackground,
TldrawSelectionForeground,
Expand All @@ -23,7 +22,6 @@ const defaultComponents = {
SelectionForeground: TldrawSelectionForeground,
SelectionBackground: TldrawSelectionBackground,
Handles: TldrawHandles,
HoveredShapeIndicator: TldrawHoveredShapeIndicator,
}

//[2]
Expand Down
24 changes: 9 additions & 15 deletions packages/editor/api-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class Arc2d extends Geometry2d {
// (undocumented)
getVertices(): Vec[];
// (undocumented)
hitTestLineSegment(A: Vec, B: Vec, _zoom: number): boolean;
hitTestLineSegment(A: Vec, B: Vec): boolean;
// (undocumented)
length: number;
// (undocumented)
Expand Down Expand Up @@ -332,7 +332,7 @@ export class Circle2d extends Geometry2d {
// (undocumented)
getVertices(): Vec[];
// (undocumented)
hitTestLineSegment(A: Vec, B: Vec, _zoom: number): boolean;
hitTestLineSegment(A: Vec, B: Vec, distance?: number): boolean;
// (undocumented)
nearestPoint(point: Vec): Vec;
// (undocumented)
Expand Down Expand Up @@ -414,7 +414,7 @@ export class CubicSpline2d extends Geometry2d {
// (undocumented)
getVertices(): Vec[];
// (undocumented)
hitTestLineSegment(A: Vec, B: Vec, zoom: number): boolean;
hitTestLineSegment(A: Vec, B: Vec): boolean;
// (undocumented)
get length(): number;
// (undocumented)
Expand Down Expand Up @@ -471,9 +471,6 @@ export function DefaultHandle({ handle, isCoarse, className, zoom }: TLHandlePro
// @public (undocumented)
export const DefaultHandles: ({ children }: TLHandlesProps) => JSX_2.Element;

// @public (undocumented)
export function DefaultHoveredShapeIndicator({ shapeId }: TLHoveredShapeIndicatorProps): JSX_2.Element | null;

// @public (undocumented)
export function DefaultScribble({ scribble, zoom, color, opacity, className }: TLScribbleProps): JSX_2.Element | null;

Expand Down Expand Up @@ -552,7 +549,7 @@ export class Edge2d extends Geometry2d {
// (undocumented)
getVertices(): Vec[];
// (undocumented)
hitTestLineSegment(A: Vec, B: Vec, _zoom: number): boolean;
hitTestLineSegment(A: Vec, B: Vec, distance?: number): boolean;
// (undocumented)
get length(): number;
// (undocumented)
Expand Down Expand Up @@ -968,7 +965,7 @@ export class Ellipse2d extends Geometry2d {
// (undocumented)
h: number;
// (undocumented)
hitTestLineSegment(A: Vec, B: Vec, zoom: number): boolean;
hitTestLineSegment(A: Vec, B: Vec): boolean;
// (undocumented)
nearestPoint(A: Vec): Vec;
// (undocumented)
Expand Down Expand Up @@ -1458,7 +1455,7 @@ export class Polyline2d extends Geometry2d {
// (undocumented)
getVertices(): Vec[];
// (undocumented)
hitTestLineSegment(A: Vec, B: Vec, zoom: number): boolean;
hitTestLineSegment(A: Vec, B: Vec, distance?: number): boolean;
// (undocumented)
get length(): number;
// (undocumented)
Expand Down Expand Up @@ -2302,11 +2299,6 @@ export type TLHistoryMark = {
onRedo: boolean;
};

// @public (undocumented)
export type TLHoveredShapeIndicatorProps = {
shapeId: TLShapeId;
};

// @public (undocumented)
export type TLInterruptEvent = (info: TLInterruptEventInfo) => void;

Expand Down Expand Up @@ -2539,6 +2531,7 @@ export type TLShapeIndicatorProps = {
color?: string | undefined;
opacity?: number;
className?: string;
hidden?: boolean;
};

// @public (undocumented)
Expand Down Expand Up @@ -2726,7 +2719,6 @@ export function useEditorComponents(): Partial<{
Spinner: ComponentType | null;
SelectionForeground: ComponentType<TLSelectionForegroundProps> | null;
SelectionBackground: ComponentType<TLSelectionBackgroundProps> | null;
HoveredShapeIndicator: ComponentType<TLHoveredShapeIndicatorProps> | null;
OnTheCanvas: ComponentType | null;
InFrontOfTheCanvas: ComponentType | null;
LoadingScreen: ComponentType | null;
Expand Down Expand Up @@ -2850,6 +2842,8 @@ export class Vec {
// (undocumented)
static DistanceToLineThroughPoint(A: VecLike, u: VecLike, P: VecLike): number;
// (undocumented)
static DistMin(A: VecLike, B: VecLike, n: number): boolean;
// (undocumented)
static Div(A: VecLike, t: number): Vec;
// (undocumented)
div(t: number): this;
Expand Down
Loading
Loading