@volter/editor-threejs 0.5.198 → 0.5.200
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/package.json +3 -3
- package/src/kit/editor-viewport.ts +35 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/editor-threejs",
|
|
3
3
|
"author": "Volter AI, Inc.",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.200",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -135,12 +135,12 @@
|
|
|
135
135
|
"serving": "./dist-node/serving.mjs"
|
|
136
136
|
},
|
|
137
137
|
"dependencies": {
|
|
138
|
-
"@volter/editor-project": "0.5.
|
|
138
|
+
"@volter/editor-project": "0.5.200",
|
|
139
139
|
"@sparkjsdev/spark": "^2.1.0",
|
|
140
140
|
"three.quarks": "^0.16.0",
|
|
141
141
|
"zod": "^4.3.6",
|
|
142
142
|
"typescript": "5.9.3",
|
|
143
|
-
"@volter/editor-sdk": "0.5.
|
|
143
|
+
"@volter/editor-sdk": "0.5.200",
|
|
144
144
|
"postprocessing": "6.38.3",
|
|
145
145
|
"quarks.core": "0.16.0",
|
|
146
146
|
"@fortawesome/free-solid-svg-icons": "^7.2.0"
|
|
@@ -65,6 +65,7 @@ import {
|
|
|
65
65
|
nativeViewportGizmoSize,
|
|
66
66
|
nativeViewportLook,
|
|
67
67
|
nativeViewportGrid,
|
|
68
|
+
nativeViewportMarqueeDash,
|
|
68
69
|
nativeViewportSelectionBox,
|
|
69
70
|
nativeViewportWire,
|
|
70
71
|
subscribeNativeSelectionTheme,
|
|
@@ -851,6 +852,36 @@ function createFloorGrid(extent: number): THREE.Mesh<THREE.PlaneGeometry, THREE.
|
|
|
851
852
|
return mesh;
|
|
852
853
|
}
|
|
853
854
|
|
|
855
|
+
/**
|
|
856
|
+
* THE BOX-SELECT RECTANGLE'S PAINT, every value the look's (ARCHITECTURE.md rule 7): its
|
|
857
|
+
* colours are `themeVars.viewport.marquee*`, which are the palette's accent wherever it names
|
|
858
|
+
* no marquee, and its dash is the look's `stage.marqueeDash` in device pixels.
|
|
859
|
+
*
|
|
860
|
+
* Without a dash it is the editor's own band, a one-pixel solid outline over the fill. With one
|
|
861
|
+
* it is Blender's two-colour line (`wm_gesture_draw_rect`): `dash` device pixels of the line's
|
|
862
|
+
* colour, then as many of the gap's, round all four sides. A CSS border can neither alternate
|
|
863
|
+
* two colours nor set its dash, so the outline is four one-pixel gradient strips over a
|
|
864
|
+
* transparent border of the same width, which keeps the box exactly where the solid band's is.
|
|
865
|
+
*/
|
|
866
|
+
function marqueeStyle(dash: number | null): Partial<CSSStyleDeclaration> {
|
|
867
|
+
const { marqueeLine: line, marqueeFill: fill, marqueeGap: gap } = themeVars.viewport;
|
|
868
|
+
if (dash === null) return { border: `1px solid ${line}`, background: fill };
|
|
869
|
+
const length = dash / (window.devicePixelRatio || 1);
|
|
870
|
+
const strip = (angle: string, place: string, size: string): string =>
|
|
871
|
+
`repeating-linear-gradient(${angle}, ${line} 0 ${length}px, ${gap} ${length}px ${2 * length}px) ` +
|
|
872
|
+
`${place} / ${size} no-repeat border-box`;
|
|
873
|
+
return {
|
|
874
|
+
border: '1px solid transparent',
|
|
875
|
+
background: [
|
|
876
|
+
strip('90deg', 'left top', '100% 1px'),
|
|
877
|
+
strip('90deg', 'left bottom', '100% 1px'),
|
|
878
|
+
strip('180deg', 'left top', '1px 100%'),
|
|
879
|
+
strip('180deg', 'right top', '1px 100%'),
|
|
880
|
+
fill,
|
|
881
|
+
].join(', '),
|
|
882
|
+
};
|
|
883
|
+
}
|
|
884
|
+
|
|
854
885
|
export class EditorViewport {
|
|
855
886
|
setTransformMode(mode: 'combined' | 'translate' | 'rotate' | 'scale'): void {
|
|
856
887
|
this._store.shell.setTransformMode(mode);
|
|
@@ -6169,8 +6200,6 @@ export class EditorViewport {
|
|
|
6169
6200
|
// retain their distinct higher tier.
|
|
6170
6201
|
Object.assign(this._marqueeDiv.style, {
|
|
6171
6202
|
position: 'fixed',
|
|
6172
|
-
border: `1px solid ${themeVars.accent.default}`,
|
|
6173
|
-
background: themeVars.accent.muted,
|
|
6174
6203
|
pointerEvents: 'none',
|
|
6175
6204
|
zIndex: zIndex.sticky,
|
|
6176
6205
|
});
|
|
@@ -6184,6 +6213,10 @@ export class EditorViewport {
|
|
|
6184
6213
|
this._marqueeDiv,
|
|
6185
6214
|
);
|
|
6186
6215
|
}
|
|
6216
|
+
// Painted as each band starts rather than once at creation: a look switched between two
|
|
6217
|
+
// drags is the next band's. Its colours would follow anyway, being variables; its dash is
|
|
6218
|
+
// a number read off the look.
|
|
6219
|
+
Object.assign(this._marqueeDiv.style, marqueeStyle(nativeViewportMarqueeDash(this._canvas)));
|
|
6187
6220
|
}
|
|
6188
6221
|
|
|
6189
6222
|
if (this._marqueeActive && this._marqueeDiv) {
|