Import and use new geometry functions in box brush commands
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import { DEFAULT_GRID_SIZE, snapPositiveSizeToGrid } from "../geometry/grid-snapping";
|
import { DEFAULT_GRID_SIZE, snapPositiveSizeToGrid } from "../geometry/grid-snapping";
|
||||||
import { createOpaqueId } from "../core/ids";
|
import { createOpaqueId } from "../core/ids";
|
||||||
|
import { cloneBoxBrushGeometry, scaleBoxBrushGeometryToSize } from "../document/brushes";
|
||||||
import { cloneSelectionForCommand, getBoxBrushOrThrow, replaceBrush, setSingleBrushSelection } from "./brush-command-helpers";
|
import { cloneSelectionForCommand, getBoxBrushOrThrow, replaceBrush, setSingleBrushSelection } from "./brush-command-helpers";
|
||||||
export function createResizeBoxBrushCommand(options) {
|
export function createResizeBoxBrushCommand(options) {
|
||||||
const resolvedSize = options.snapToGrid === false ? options.size : snapPositiveSizeToGrid(options.size, options.gridSize ?? DEFAULT_GRID_SIZE);
|
const resolvedSize = options.snapToGrid === false ? options.size : snapPositiveSizeToGrid(options.size, options.gridSize ?? DEFAULT_GRID_SIZE);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import type { ToolMode } from "../core/tool-mode";
|
import type { ToolMode } from "../core/tool-mode";
|
||||||
import { DEFAULT_GRID_SIZE, snapPositiveSizeToGrid } from "../geometry/grid-snapping";
|
import { DEFAULT_GRID_SIZE, snapPositiveSizeToGrid } from "../geometry/grid-snapping";
|
||||||
|
import { cloneBoxBrushGeometry, scaleBoxBrushGeometryToSize } from "../document/brushes";
|
||||||
|
|
||||||
import { createOpaqueId } from "../core/ids";
|
import { createOpaqueId } from "../core/ids";
|
||||||
import type { EditorSelection } from "../core/selection";
|
import type { EditorSelection } from "../core/selection";
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { createOpaqueId } from "../core/ids";
|
import { createOpaqueId } from "../core/ids";
|
||||||
|
import { cloneBoxBrushGeometry, scaleBoxBrushGeometryToSize } from "../document/brushes";
|
||||||
import { cloneSelectionForCommand, getBoxBrushOrThrow, replaceBrush, setSingleBrushEdgeSelection, setSingleBrushFaceSelection, setSingleBrushSelection, setSingleBrushVertexSelection } from "./brush-command-helpers";
|
import { cloneSelectionForCommand, getBoxBrushOrThrow, replaceBrush, setSingleBrushEdgeSelection, setSingleBrushFaceSelection, setSingleBrushSelection, setSingleBrushVertexSelection } from "./brush-command-helpers";
|
||||||
function cloneVec3(vector) {
|
function cloneVec3(vector) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import type { ToolMode } from "../core/tool-mode";
|
|||||||
import { createOpaqueId } from "../core/ids";
|
import { createOpaqueId } from "../core/ids";
|
||||||
import type { EditorSelection } from "../core/selection";
|
import type { EditorSelection } from "../core/selection";
|
||||||
import type { Vec3 } from "../core/vector";
|
import type { Vec3 } from "../core/vector";
|
||||||
|
import { cloneBoxBrushGeometry, scaleBoxBrushGeometryToSize } from "../document/brushes";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
cloneSelectionForCommand,
|
cloneSelectionForCommand,
|
||||||
|
|||||||
Reference in New Issue
Block a user