mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Type refactor
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
parent
47064a3662
commit
2137f2b806
6 changed files with 63 additions and 262 deletions
|
@ -164,14 +164,14 @@ export const getElementShape = (
|
|||
const [, , , , cx, cy] = getElementAbsoluteCoords(element, elementsMap);
|
||||
|
||||
return shouldTestInside(element)
|
||||
? getClosedCurveShape<GlobalPoint>(
|
||||
? getClosedCurveShape(
|
||||
element,
|
||||
roughShape,
|
||||
pointFrom<GlobalPoint>(element.x, element.y),
|
||||
element.angle,
|
||||
pointFrom(cx, cy),
|
||||
)
|
||||
: getCurveShape<GlobalPoint>(
|
||||
: getCurveShape(
|
||||
roughShape,
|
||||
pointFrom<GlobalPoint>(element.x, element.y),
|
||||
element.angle,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { Arc, CubicBezier, Segment } from "../math";
|
||||
import type { Arc, Curve, Segment } from "../math";
|
||||
import { isSegment, segment, pointFrom, type GlobalPoint } from "../math";
|
||||
import { isBounds } from "./element/typeChecks";
|
||||
import type { Bounds } from "./element/types";
|
||||
|
@ -15,12 +15,12 @@ declare global {
|
|||
|
||||
export type DebugElement = {
|
||||
color: string;
|
||||
data: Segment<GlobalPoint> | Arc<GlobalPoint> | CubicBezier<GlobalPoint>;
|
||||
data: Segment<GlobalPoint> | Arc<GlobalPoint> | Curve<GlobalPoint>;
|
||||
permanent: boolean;
|
||||
};
|
||||
|
||||
export const debugDrawCubicBezier = (
|
||||
c: CubicBezier<GlobalPoint>,
|
||||
c: Curve<GlobalPoint>,
|
||||
opts?: {
|
||||
color?: string;
|
||||
permanent?: boolean;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue