Update viewport transient state to handle new brush types
This commit is contained in:
@@ -13,6 +13,13 @@ export type CreationTarget =
|
||||
| {
|
||||
kind: "box-brush";
|
||||
}
|
||||
| {
|
||||
kind: "wedge-brush";
|
||||
}
|
||||
| {
|
||||
kind: "cylinder-brush";
|
||||
sideCount: number;
|
||||
}
|
||||
| {
|
||||
kind: "entity";
|
||||
entityKind: EntityKind;
|
||||
@@ -68,6 +75,15 @@ export function cloneViewportToolPreview(toolPreview: ViewportToolPreview): View
|
||||
kind: "model-instance",
|
||||
assetId: toolPreview.target.assetId
|
||||
}
|
||||
: toolPreview.target.kind === "wedge-brush"
|
||||
? {
|
||||
kind: "wedge-brush"
|
||||
}
|
||||
: toolPreview.target.kind === "cylinder-brush"
|
||||
? {
|
||||
kind: "cylinder-brush",
|
||||
sideCount: toolPreview.target.sideCount
|
||||
}
|
||||
: {
|
||||
kind: "box-brush"
|
||||
},
|
||||
@@ -110,6 +126,14 @@ export function areViewportToolPreviewsEqual(left: ViewportToolPreview, right: V
|
||||
return false;
|
||||
}
|
||||
|
||||
if (
|
||||
left.target.kind === "cylinder-brush" &&
|
||||
right.target.kind === "cylinder-brush" &&
|
||||
left.target.sideCount !== right.target.sideCount
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (left.center === null || right.center === null) {
|
||||
return left.center === right.center;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user