@reekon-tools/boldr-cad 1.5.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -1
- package/dist/app/state.d.ts +3 -3
- package/dist/data/provider.d.ts +2 -1
- package/dist/data/sync.js +4 -1
- package/dist/data/sync.js.map +1 -1
- package/dist/editor/actions.js +122 -19
- package/dist/editor/actions.js.map +1 -1
- package/dist/editor/advance.d.ts +2 -0
- package/dist/editor/advance.js +23 -0
- package/dist/editor/advance.js.map +1 -0
- package/dist/editor/dimSize.d.ts +13 -0
- package/dist/editor/dimSize.js +50 -0
- package/dist/editor/dimSize.js.map +1 -0
- package/dist/editor/gestures.js +30 -7
- package/dist/editor/gestures.js.map +1 -1
- package/dist/editor/keypad.d.ts +8 -0
- package/dist/editor/keypad.js +15 -1
- package/dist/editor/keypad.js.map +1 -1
- package/dist/editor/keys.js +2 -1
- package/dist/editor/keys.js.map +1 -1
- package/dist/editor/laser.d.ts +13 -2
- package/dist/editor/laser.js +42 -14
- package/dist/editor/laser.js.map +1 -1
- package/dist/editor/linkActions.d.ts +29 -11
- package/dist/editor/linkActions.js +76 -29
- package/dist/editor/linkActions.js.map +1 -1
- package/dist/editor/links.d.ts +13 -0
- package/dist/editor/links.js +7 -1
- package/dist/editor/links.js.map +1 -1
- package/dist/editor/mode.d.ts +2 -1
- package/dist/editor/mode.js +7 -5
- package/dist/editor/mode.js.map +1 -1
- package/dist/editor/ports.d.ts +9 -0
- package/dist/editor/ports.js +2 -0
- package/dist/editor/ports.js.map +1 -1
- package/dist/editor/selection.js +1 -1
- package/dist/editor/selection.js.map +1 -1
- package/dist/editor/tooltips.js +1 -0
- package/dist/editor/tooltips.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/model/clockwise.d.ts +11 -0
- package/dist/model/clockwise.js +123 -0
- package/dist/model/clockwise.js.map +1 -0
- package/dist/model/constraints.js +2 -0
- package/dist/model/constraints.js.map +1 -1
- package/dist/model/geom.d.ts +2 -0
- package/dist/model/geom.js +11 -0
- package/dist/model/geom.js.map +1 -1
- package/dist/model/links.d.ts +6 -1
- package/dist/model/links.js +6 -1
- package/dist/model/links.js.map +1 -1
- package/dist/model/scale.js +3 -0
- package/dist/model/scale.js.map +1 -1
- package/dist/model/settings.d.ts +2 -0
- package/dist/model/settings.js +1 -1
- package/dist/model/settings.js.map +1 -1
- package/dist/model/sketch.d.ts +5 -1
- package/dist/model/sketch.js +19 -18
- package/dist/model/sketch.js.map +1 -1
- package/dist/model/trim.d.ts +54 -0
- package/dist/model/trim.js +219 -0
- package/dist/model/trim.js.map +1 -0
- package/dist/model/types.d.ts +24 -2
- package/dist/react/BottomBar.js +94 -25
- package/dist/react/BottomBar.js.map +1 -1
- package/dist/react/CadEditor.js +18 -9
- package/dist/react/CadEditor.js.map +1 -1
- package/dist/react/Drawer.js +3 -2
- package/dist/react/Drawer.js.map +1 -1
- package/dist/react/PlanCanvas.native.js +15 -9
- package/dist/react/PlanCanvas.native.js.map +1 -1
- package/dist/react/PlanCanvas.web.js +17 -5
- package/dist/react/PlanCanvas.web.js.map +1 -1
- package/dist/react/ShapeMenu.js +3 -2
- package/dist/react/ShapeMenu.js.map +1 -1
- package/dist/react/ToolTip.js +3 -2
- package/dist/react/ToolTip.js.map +1 -1
- package/dist/react/TopBar.js +4 -3
- package/dist/react/TopBar.js.map +1 -1
- package/dist/react/editorBox.d.ts +8 -0
- package/dist/react/editorBox.js +10 -0
- package/dist/react/editorBox.js.map +1 -0
- package/dist/react/host.d.ts +7 -1
- package/dist/react/host.js +12 -2
- package/dist/react/host.js.map +1 -1
- package/dist/react/pageLock.native.d.ts +2 -0
- package/dist/react/pageLock.native.js +2 -0
- package/dist/react/pageLock.native.js.map +1 -1
- package/dist/react/pageLock.web.d.ts +6 -0
- package/dist/react/pageLock.web.js +12 -3
- package/dist/react/pageLock.web.js.map +1 -1
- package/dist/react/ports.js +10 -4
- package/dist/react/ports.js.map +1 -1
- package/dist/react/saving.d.ts +7 -1
- package/dist/react/saving.js +10 -2
- package/dist/react/saving.js.map +1 -1
- package/dist/react/store.d.ts +5 -2
- package/dist/react/store.js +4 -1
- package/dist/react/store.js.map +1 -1
- package/dist/render/draw.d.ts +7 -0
- package/dist/render/draw.js +41 -15
- package/dist/render/draw.js.map +1 -1
- package/dist/render/linkTile.js +2 -2
- package/dist/render/linkTile.js.map +1 -1
- package/dist/render/navigate.d.ts +11 -6
- package/dist/render/navigate.js +34 -20
- package/dist/render/navigate.js.map +1 -1
- package/dist/render/snap.d.ts +5 -0
- package/dist/render/snap.js +84 -14
- package/dist/render/snap.js.map +1 -1
- package/dist/render/view.js +7 -2
- package/dist/render/view.js.map +1 -1
- package/dist/solver/equations.js +30 -16
- package/dist/solver/equations.js.map +1 -1
- package/dist/tools/dim.d.ts +6 -0
- package/dist/tools/dim.js +28 -4
- package/dist/tools/dim.js.map +1 -1
- package/dist/tools/modify.d.ts +32 -4
- package/dist/tools/modify.js +247 -97
- package/dist/tools/modify.js.map +1 -1
- package/dist/tools/registry.d.ts +2 -0
- package/dist/tools/registry.js +8 -0
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/select.d.ts +11 -8
- package/dist/tools/select.js +51 -19
- package/dist/tools/select.js.map +1 -1
- package/package.json +1 -1
- package/src/app/state.ts +3 -3
- package/src/data/provider.ts +2 -2
- package/src/data/sync.ts +4 -1
- package/src/editor/actions.ts +98 -16
- package/src/editor/advance.ts +23 -0
- package/src/editor/dimSize.ts +53 -0
- package/src/editor/gestures.ts +31 -9
- package/src/editor/keypad.ts +17 -1
- package/src/editor/keys.ts +2 -1
- package/src/editor/laser.ts +45 -14
- package/src/editor/linkActions.ts +87 -26
- package/src/editor/links.ts +17 -1
- package/src/editor/mode.ts +7 -5
- package/src/editor/ports.ts +10 -0
- package/src/editor/selection.ts +1 -1
- package/src/editor/tooltips.ts +1 -0
- package/src/index.ts +2 -2
- package/src/model/clockwise.ts +121 -0
- package/src/model/constraints.ts +1 -0
- package/src/model/geom.ts +10 -0
- package/src/model/links.ts +6 -1
- package/src/model/scale.ts +2 -0
- package/src/model/settings.ts +3 -1
- package/src/model/sketch.ts +14 -7
- package/src/model/trim.ts +188 -0
- package/src/model/types.ts +19 -2
- package/src/react/BottomBar.tsx +109 -25
- package/src/react/CadEditor.tsx +19 -9
- package/src/react/Drawer.tsx +3 -2
- package/src/react/PlanCanvas.native.tsx +25 -12
- package/src/react/PlanCanvas.web.tsx +17 -5
- package/src/react/ShapeMenu.tsx +3 -2
- package/src/react/ToolTip.tsx +3 -2
- package/src/react/TopBar.tsx +4 -3
- package/src/react/editorBox.ts +20 -0
- package/src/react/host.ts +12 -2
- package/src/react/pageLock.native.ts +2 -0
- package/src/react/pageLock.web.ts +12 -3
- package/src/react/ports.ts +10 -4
- package/src/react/saving.ts +10 -2
- package/src/react/store.ts +5 -2
- package/src/render/draw.ts +38 -16
- package/src/render/linkTile.ts +2 -2
- package/src/render/navigate.ts +31 -20
- package/src/render/snap.ts +80 -15
- package/src/render/view.ts +6 -2
- package/src/solver/equations.ts +30 -16
- package/src/tools/dim.ts +28 -4
- package/src/tools/modify.ts +205 -69
- package/src/tools/registry.ts +8 -0
- package/src/tools/select.ts +47 -20
- package/src/ui/domPorts.ts +2 -0
- package/dist/react/LaserTray.d.ts +0 -4
- package/dist/react/LaserTray.js +0 -26
- package/dist/react/LaserTray.js.map +0 -1
- package/src/react/LaserTray.tsx +0 -42
package/dist/react/ports.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ports.js","sourceRoot":"","sources":["../../src/react/ports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EA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,CAAC;IACD,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC,SAAS,IAAI,iBAAiB,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAClF,IAAI;QACF,IAAI,UAAU,EAAE,EAAE,CAAC;YAAC,KAAK,WAAW,EAAE,CAAC;YAAC,OAAO;QAAC,CAAC;QACjD,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC;QACrB,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,qDAAqD,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACvH,CAAC;CACF,CAAC"}
|
package/dist/react/saving.d.ts
CHANGED
|
@@ -2,8 +2,14 @@ import type { CadSync } from '../data/sync';
|
|
|
2
2
|
export type CadSaveState = 'saved' | 'dirty' | 'saving' | 'error';
|
|
3
3
|
export declare const manualSave: () => boolean;
|
|
4
4
|
export declare const saveState: () => CadSaveState;
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Start manual saving for the drawing open in `sync`; `listener` hears each change of state, and the first, 'saved',
|
|
7
|
+
* once the editor has mounted (announceSaveState). This runs as the editor first renders, and a host keeps the state in
|
|
8
|
+
* its own: React won't have one component set another's state while it renders.
|
|
9
|
+
*/
|
|
6
10
|
export declare function startManualSave(sync: CadSync, listener: ((s: CadSaveState) => void) | null): void;
|
|
11
|
+
/** Tell the host the state as it is now (the editor, once it has mounted). */
|
|
12
|
+
export declare function announceSaveState(): void;
|
|
7
13
|
export declare function stopManualSave(): void;
|
|
8
14
|
/** An edit was made: unsaved from now on (cheap, so it runs with every refresh of the editor). */
|
|
9
15
|
export declare function noteEdits(): void;
|
package/dist/react/saving.js
CHANGED
|
@@ -20,10 +20,18 @@ function setState(s) {
|
|
|
20
20
|
sv.listener?.(s);
|
|
21
21
|
notify();
|
|
22
22
|
}
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Start manual saving for the drawing open in `sync`; `listener` hears each change of state, and the first, 'saved',
|
|
25
|
+
* once the editor has mounted (announceSaveState). This runs as the editor first renders, and a host keeps the state in
|
|
26
|
+
* its own: React won't have one component set another's state while it renders.
|
|
27
|
+
*/
|
|
24
28
|
export function startManualSave(sync, listener) {
|
|
25
29
|
Object.assign(sv, { manual: true, state: 'saved', cleanSeq: ed.editSeq, sync, listener });
|
|
26
|
-
|
|
30
|
+
}
|
|
31
|
+
/** Tell the host the state as it is now (the editor, once it has mounted). */
|
|
32
|
+
export function announceSaveState() {
|
|
33
|
+
if (sv.manual)
|
|
34
|
+
sv.listener?.(sv.state);
|
|
27
35
|
}
|
|
28
36
|
export function stopManualSave() {
|
|
29
37
|
Object.assign(sv, { manual: false, sync: null, listener: null });
|
package/dist/react/saving.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saving.js","sourceRoot":"","sources":["../../src/react/saving.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAU9C,MAAM,EAAE,GAAG,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC;IAC7B,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,OAAuB;IAC9B,gEAAgE;IAChE,QAAQ,EAAE,CAAC;IACX,IAAI,EAAE,IAAsB;IAC5B,QAAQ,EAAE,IAA0C;CACrD,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,UAAU,GAAG,GAAY,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC;AACnD,MAAM,CAAC,MAAM,SAAS,GAAG,GAAiB,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;AAC3C,CAAC;AAED,mHAAmH;AACnH,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IACvD,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACnB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC/B,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;IACxB,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACtD,IAAI,KAAK;QAAE,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACrC,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;IAClB,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,oDAAoD;IACvE,IAAI,IAAI,CAAC,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;QAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAAC,OAAO,KAAK,CAAC;IAAC,CAAC;IACpE,uCAAuC;IACvC,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;IAChC,IAAI,CAAC,KAAK;QAAE,EAAE,CAAC,QAAQ,GAAG,EAAE,CAAC,OAAO,CAAC;IACrC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/react/store.d.ts
CHANGED
|
@@ -47,8 +47,11 @@ export declare const ui: {
|
|
|
47
47
|
text: string;
|
|
48
48
|
seq: number;
|
|
49
49
|
} | null;
|
|
50
|
-
/**
|
|
51
|
-
|
|
50
|
+
/**
|
|
51
|
+
* what's open above the bar: the selected image's opacity or turn, or the link tiles' size (sliders), or Open's
|
|
52
|
+
* question (here, or side by side)
|
|
53
|
+
*/
|
|
54
|
+
imgPop: null | 'opacity' | 'rotate' | 'tilesize' | 'dimsize' | 'open';
|
|
52
55
|
/** the tool each shared place on the rail draws with (the last picked; editor/mode.ts TOOL_GROUPS), and the menu of
|
|
53
56
|
a group's tools, open beside its place at x, y */
|
|
54
57
|
picked: Record<string, string>;
|
package/dist/react/store.js
CHANGED
|
@@ -44,7 +44,10 @@ export const ui = sessionState(() => ({
|
|
|
44
44
|
palette: false,
|
|
45
45
|
/** what the tool just picked from the rail does (a note under the tabs that goes by itself); seq tells one pick from the next */
|
|
46
46
|
toolTip: null,
|
|
47
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* what's open above the bar: the selected image's opacity or turn, or the link tiles' size (sliders), or Open's
|
|
49
|
+
* question (here, or side by side)
|
|
50
|
+
*/
|
|
48
51
|
imgPop: null,
|
|
49
52
|
/** the tool each shared place on the rail draws with (the last picked; editor/mode.ts TOOL_GROUPS), and the menu of
|
|
50
53
|
a group's tools, open beside its place at x, y */
|
package/dist/react/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/react/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;;EAGE;AAEF,IAAI,OAAO,GAAG,CAAC,CAAC;AAChB,MAAM,SAAS,GAAG,IAAI,GAAG,EAAc,CAAC;AAExC,2FAA2F;AAC3F,MAAM,UAAU,MAAM;IACpB,OAAO,EAAE,CAAC;IACV,KAAK,MAAM,CAAC,IAAI,SAAS;QAAE,CAAC,EAAE,CAAC;AACjC,CAAC;AAED,MAAM,SAAS,GAAG,CAAC,CAAa,EAAE,EAAE,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CA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,QAAQ,EAAE,IAA4E;IACtF,+CAA+C;IAC/C,MAAM,EAAE,IAAwB;IAChC,8DAA8D;IAC9D,UAAU,EAAE,IAAqB;IACjC,IAAI,EAAE,IAA6B;IACnC,OAAO,EAAE,KAAK;IACd,iIAAiI;IACjI,OAAO,EAAE,IAA4C;IACrD;;;OAGG;IACH,MAAM,EAAE,IAAqE;IAC7E;yDACqD;IACrD,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAA4B;IACpE,SAAS,EAAE,IAAsD;IACjE,uFAAuF;IACvF,IAAI,EAAE,KAAkC;IACxC,+FAA+F;IAC/F,aAAa,EAAE,CAAC;IAChB;;;OAGG;IACH,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE;IAC9C,8GAA8G;IAC9G,OAAO,EAAE,KAAK;CACf,CAAC,CAAC,CAAC"}
|
package/dist/render/draw.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ type C2D = DrawCtx;
|
|
|
6
6
|
/** A rounded rectangle's path, its corners smoothed as Figma's 60% ("iOS"): render/squircle.ts. */
|
|
7
7
|
export declare function rr(c: C2D, x: number, y: number, w: number, h: number, r: number): void;
|
|
8
8
|
export interface ChipOpts {
|
|
9
|
+
/** `r`: its corners' radius (5) */
|
|
9
10
|
bg: string;
|
|
10
11
|
fg: string;
|
|
11
12
|
border?: [string, number?] | null;
|
|
@@ -13,6 +14,7 @@ export interface ChipOpts {
|
|
|
13
14
|
pad?: number;
|
|
14
15
|
h?: number;
|
|
15
16
|
minW?: number;
|
|
17
|
+
r?: number;
|
|
16
18
|
kind?: HitChip['kind'];
|
|
17
19
|
id?: string;
|
|
18
20
|
rot?: number;
|
|
@@ -31,6 +33,11 @@ export declare function chipSize(c: C2D, text: string, { font, pad, h, minW, mar
|
|
|
31
33
|
w: number;
|
|
32
34
|
h: number;
|
|
33
35
|
};
|
|
36
|
+
/**
|
|
37
|
+
* A measurement tile's size — a dimension's chip: its font, padding, height and corners — times the file's measurement
|
|
38
|
+
* tile size (settings.chipPct, editor/dimSize.ts). At 100%, chip()'s own: 12 px, 7, 22, 5.
|
|
39
|
+
*/
|
|
40
|
+
export declare function dimChip(): Pick<ChipOpts, 'font' | 'pad' | 'h' | 'r'>;
|
|
34
41
|
/** Rounded label on the canvas; registers a hit region when `kind` is given. */
|
|
35
42
|
export declare function chip(c: C2D, text: string, cx: number, cy: number, opts: ChipOpts): number;
|
|
36
43
|
/**
|
package/dist/render/draw.js
CHANGED
|
@@ -60,6 +60,14 @@ export function chipSize(c, text, { font = '600 12px', pad = 7, h = 22, minW = 0
|
|
|
60
60
|
const room = mark ? (LINKED.pad * 2 + LINKED.badge + LINKED.gap) * (h / LINKED.h) : pad * 2;
|
|
61
61
|
return { w: Math.max(minW, c.measureText(text).width + room), h };
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* A measurement tile's size — a dimension's chip: its font, padding, height and corners — times the file's measurement
|
|
65
|
+
* tile size (settings.chipPct, editor/dimSize.ts). At 100%, chip()'s own: 12 px, 7, 22, 5.
|
|
66
|
+
*/
|
|
67
|
+
export function dimChip() {
|
|
68
|
+
const k = settings.chipPct / 100;
|
|
69
|
+
return k === 1 ? {} : { font: '600 ' + 12 * k + 'px', pad: 7 * k, h: 22 * k, r: 5 * k };
|
|
70
|
+
}
|
|
63
71
|
/** Rounded label on the canvas; registers a hit region when `kind` is given. */
|
|
64
72
|
export function chip(c, text, cx, cy, opts) {
|
|
65
73
|
const { bg, fg, border, kind, id, rot = 0, mark } = opts;
|
|
@@ -70,7 +78,7 @@ export function chip(c, text, cx, cy, opts) {
|
|
|
70
78
|
c.rotate(rot);
|
|
71
79
|
c.translate(-cx, -cy);
|
|
72
80
|
}
|
|
73
|
-
rr(c, x, y, w, h, 5);
|
|
81
|
+
rr(c, x, y, w, h, opts.r ?? 5);
|
|
74
82
|
c.fillStyle = bg;
|
|
75
83
|
c.fill();
|
|
76
84
|
if (border) {
|
|
@@ -141,8 +149,17 @@ function drawUnderlay(c, T) {
|
|
|
141
149
|
c.translate(x, y);
|
|
142
150
|
if (u.rot)
|
|
143
151
|
c.rotate((u.rot * Math.PI) / 180);
|
|
144
|
-
if (ready)
|
|
145
|
-
|
|
152
|
+
if (ready) {
|
|
153
|
+
// cropped: the picture whole, past the part that shows, clipped to it
|
|
154
|
+
const k = u.crop;
|
|
155
|
+
if (k) {
|
|
156
|
+
c.beginPath();
|
|
157
|
+
c.rect(-w / 2, -hh / 2, w, hh);
|
|
158
|
+
c.clip();
|
|
159
|
+
}
|
|
160
|
+
const fw = k ? w / (1 - k.l - k.r) : w, fh = k ? hh / (1 - k.t - k.b) : hh;
|
|
161
|
+
c.drawImage(im, -w / 2 - (k ? k.l * fw : 0), -hh / 2 - (k ? k.t * fh : 0), fw, fh);
|
|
162
|
+
}
|
|
146
163
|
else {
|
|
147
164
|
c.fillStyle = '#2B2C2E';
|
|
148
165
|
c.fillRect(-w / 2, -hh / 2, w, hh);
|
|
@@ -160,12 +177,17 @@ function drawUnderlay(c, T) {
|
|
|
160
177
|
/**
|
|
161
178
|
* Each expanded photo's badge: its link icon in a white disc in its top-right corner (imageLinkBadge), over the drawing
|
|
162
179
|
* — always, as Skia's, selected or not, locked or not: it says the photo is the job's, and a tap on it opens it.
|
|
180
|
+
* `selected`: the selected photos' badges, drawn with their outlines and handles (paintOverlay), or the rest, with the
|
|
181
|
+
* drawing. A device keeps the drawing as a picture while a photo is moved, sized, cropped or turned, and draws only
|
|
182
|
+
* the photos and the moving parts again: a badge kept with the drawing stayed where the photo had been.
|
|
163
183
|
*/
|
|
164
|
-
function drawImageLinks(c, T) {
|
|
184
|
+
function drawImageLinks(c, T, selected) {
|
|
165
185
|
if (!settings.layers.underlay)
|
|
166
186
|
return;
|
|
167
187
|
const { W, H } = cvs;
|
|
168
188
|
for (const u of page().underlays) {
|
|
189
|
+
if (isSel('underlay', u.id) !== selected)
|
|
190
|
+
continue;
|
|
169
191
|
const b = imageLinkBadge(T, u);
|
|
170
192
|
if (!b || b.x < -b.r || b.y < -b.r || b.x > W + b.r || b.y > H + b.r)
|
|
171
193
|
continue;
|
|
@@ -827,7 +849,7 @@ function drawDims(c, T, sk) {
|
|
|
827
849
|
}
|
|
828
850
|
c.restore();
|
|
829
851
|
}
|
|
830
|
-
const text = wrap(fmtAng(val)), opts = { bg, fg, border, kind: 'dim', id, mark };
|
|
852
|
+
const text = wrap(fmtAng(val)), opts = { bg, fg, border, kind: 'dim', id, mark, ...dimChip() };
|
|
831
853
|
// (left where it was drawn: 50 px out along the bisector, or as far as its corners stay clear of the corner — a
|
|
832
854
|
// linked chip is wider)
|
|
833
855
|
const sz = chipSize(c, text, opts), out = Math.max(50, Math.hypot(sz.w, sz.h) / 2 + 28);
|
|
@@ -836,7 +858,7 @@ function drawDims(c, T, sk) {
|
|
|
836
858
|
continue;
|
|
837
859
|
}
|
|
838
860
|
if (d.type === 'diam' && 'o' in A) {
|
|
839
|
-
drawDiameter(c, T, A.o, A.r, d, d.rad ? 'R ' + wrap(fmtLen(val / 2)) : 'Ø ' + wrap(fmtLen(val)), bad ? TH.red : ref ? TH.chipline : TH.blue, { bg, fg, border, kind: 'dim', id, mark }, ref);
|
|
861
|
+
drawDiameter(c, T, A.o, A.r, d, d.rad ? 'R ' + wrap(fmtLen(val / 2)) : 'Ø ' + wrap(fmtLen(val)), bad ? TH.red : ref ? TH.chipline : TH.blue, { bg, fg, border, kind: 'dim', id, mark, ...dimChip() }, ref);
|
|
840
862
|
continue;
|
|
841
863
|
}
|
|
842
864
|
if (!('a' in A))
|
|
@@ -860,7 +882,7 @@ function drawDims(c, T, sk) {
|
|
|
860
882
|
c.stroke();
|
|
861
883
|
c.restore();
|
|
862
884
|
}
|
|
863
|
-
chip(c, wrap(fmtLen(val)), mx, my, { bg, fg, border, kind: 'dim', id, mark });
|
|
885
|
+
chip(c, wrap(fmtLen(val)), mx, my, { bg, fg, border, kind: 'dim', id, mark, ...dimChip() });
|
|
864
886
|
}
|
|
865
887
|
}
|
|
866
888
|
/**
|
|
@@ -874,7 +896,8 @@ function drawDims(c, T, sk) {
|
|
|
874
896
|
function drawOpeningDims(c, T, sk) {
|
|
875
897
|
if (!settings.layers.dims || ed.mode !== 'draft')
|
|
876
898
|
return;
|
|
877
|
-
|
|
899
|
+
// (the rows, and how far apart along them, grow with the measurement tiles: editor/dimSize.ts)
|
|
900
|
+
const k = settings.chipPct / 100, ROW = (26 * k) / T.s;
|
|
878
901
|
for (const id in sk.openings) {
|
|
879
902
|
const o = sk.openings[id], g = openingFrame(sk, id);
|
|
880
903
|
if (!g)
|
|
@@ -882,7 +905,7 @@ function drawOpeningDims(c, T, sk) {
|
|
|
882
905
|
const l = sk.lines[o.line], L = hyp(sk.points[l.b].x - g.A.x, sk.points[l.b].y - g.A.y);
|
|
883
906
|
const side = outsideSide(sk, o.line);
|
|
884
907
|
// automatic rows start 34 px past the wall face (clear of the H/V badges); a dragged dimension keeps its own offset
|
|
885
|
-
const k0 = g.t / 2 + 34 / T.s;
|
|
908
|
+
const k0 = g.t / 2 + (34 + 11 * (k - 1)) / T.s;
|
|
886
909
|
const kRow = (row) => side * (k0 + row * ROW);
|
|
887
910
|
/** screen point at `s` along the wall, `k` (signed, world) off its centerline */
|
|
888
911
|
const P = (s, k) => S(T, g.A.x + g.ux * s + g.nx * k, g.A.y + g.uy * s + g.ny * k);
|
|
@@ -929,7 +952,7 @@ function drawOpeningDims(c, T, sk) {
|
|
|
929
952
|
};
|
|
930
953
|
const label = (s0, s1, part, text, k, bg = TH.blue, fg = '#fff', border = null) => {
|
|
931
954
|
const [mx, my] = P((s0 + s1) / 2, k);
|
|
932
|
-
chip(c, text, mx, my, { bg, fg, border: odimSel(part) ? [TH.yellow, 2] : border, kind: 'odim', id });
|
|
955
|
+
chip(c, text, mx, my, { bg, fg, border: odimSel(part) ? [TH.yellow, 2] : border, kind: 'odim', id, ...dimChip() });
|
|
933
956
|
if (hits && hits.length)
|
|
934
957
|
hits[hits.length - 1].part = part;
|
|
935
958
|
};
|
|
@@ -937,7 +960,7 @@ function drawOpeningDims(c, T, sk) {
|
|
|
937
960
|
// spans that only touch end to end share a row (a chained string)
|
|
938
961
|
const rows = [o.wOff == null ? [[g.s0, g.s1]] : []];
|
|
939
962
|
const place = (a, b) => {
|
|
940
|
-
const lo = Math.min(a, b), hi = Math.max(a, b), gap = 64 / T.s;
|
|
963
|
+
const lo = Math.min(a, b), hi = Math.max(a, b), gap = (64 * k) / T.s;
|
|
941
964
|
const clash = ([x, y]) => (lo < y - 1e-6 && hi > x + 1e-6) || Math.abs((lo + hi) / 2 - (x + y) / 2) < gap;
|
|
942
965
|
for (let r = 0;; r++) {
|
|
943
966
|
rows[r] = rows[r] || [];
|
|
@@ -1540,7 +1563,7 @@ function drawSnap(c, T) {
|
|
|
1540
1563
|
if (s.kind !== 'free' && s.kind !== 'grid') {
|
|
1541
1564
|
c.lineWidth = 2;
|
|
1542
1565
|
c.beginPath();
|
|
1543
|
-
if (s.kind === 'point')
|
|
1566
|
+
if (s.kind === 'point' || s.kind === 'facecorner')
|
|
1544
1567
|
c.arc(x, y, 8, 0, Math.PI * 2);
|
|
1545
1568
|
else if (s.kind === 'mid') {
|
|
1546
1569
|
c.moveTo(x, y - 8);
|
|
@@ -1677,8 +1700,8 @@ function paintPlanView(ctx, sk, m, under = true) {
|
|
|
1677
1700
|
drawOpeningAnchors(ctx, T, sk);
|
|
1678
1701
|
drawDims(ctx, T, sk);
|
|
1679
1702
|
drawOpeningDims(ctx, T, sk);
|
|
1680
|
-
// (an expanded photo's badge over the drawing, under the markup: as it's tapped)
|
|
1681
|
-
drawImageLinks(ctx, T);
|
|
1703
|
+
// (an expanded photo's badge over the drawing, under the markup: as it's tapped. A selected one's: paintOverlay)
|
|
1704
|
+
drawImageLinks(ctx, T, false);
|
|
1682
1705
|
drawNotes(ctx, T, sk);
|
|
1683
1706
|
drawNoteSelection(ctx, T);
|
|
1684
1707
|
}
|
|
@@ -1736,7 +1759,10 @@ function drawSurveyCursor(ctx, T) {
|
|
|
1736
1759
|
}
|
|
1737
1760
|
function paintOverlay(ctx, W, H, fixed = ctx) {
|
|
1738
1761
|
const T = mainT();
|
|
1739
|
-
// a selected image's outline and handles: with the moving parts, as it's turned, moved or sized (over the
|
|
1762
|
+
// a selected image's badge, outline and handles: with the moving parts, as it's turned, moved or sized (over the
|
|
1763
|
+
// drawing; the badge under the handles, as it was under them kept with the drawing). The wall view has no photos.
|
|
1764
|
+
if (!(elevOpen() && elev.frame))
|
|
1765
|
+
drawImageLinks(ctx, T, true);
|
|
1740
1766
|
drawUnderlaySelection(ctx, T);
|
|
1741
1767
|
if (ed.preview)
|
|
1742
1768
|
ed.preview(ctx, T);
|