Move ResizeGizmo handles inside bounding box for better selection
- Reverse padding direction in HandleGeometry: - Corner handles now positioned inward (add padding to min, subtract from max) - Edge handles now positioned inward (same reversal) - Face handles now positioned inward (same reversal) - Remove padding from bounding box wireframe to match mesh bounds - Handles are now 5% inside edges instead of 5% outside - Improves handle selection reliability - Prevents unwanted gizmo auto-hide when pointer moves to handles 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
26b48b26c8
commit
204ef670f9
@ -19,9 +19,9 @@ export class HandleGeometry {
|
||||
const max = boundingBox.maximumWorld;
|
||||
const center = boundingBox.centerWorld;
|
||||
|
||||
// Apply padding
|
||||
const paddedMin = min.subtract(new Vector3(padding, padding, padding));
|
||||
const paddedMax = max.add(new Vector3(padding, padding, padding));
|
||||
// Apply padding to position handles inward from bounding box edges
|
||||
const paddedMin = min.add(new Vector3(padding, padding, padding));
|
||||
const paddedMax = max.subtract(new Vector3(padding, padding, padding));
|
||||
|
||||
const corners: HandlePosition[] = [];
|
||||
const positions = [
|
||||
@ -60,9 +60,9 @@ export class HandleGeometry {
|
||||
const max = boundingBox.maximumWorld;
|
||||
const center = boundingBox.centerWorld;
|
||||
|
||||
// Apply padding
|
||||
const paddedMin = min.subtract(new Vector3(padding, padding, padding));
|
||||
const paddedMax = max.add(new Vector3(padding, padding, padding));
|
||||
// Apply padding to position handles inward from bounding box edges
|
||||
const paddedMin = min.add(new Vector3(padding, padding, padding));
|
||||
const paddedMax = max.subtract(new Vector3(padding, padding, padding));
|
||||
|
||||
// Calculate midpoints
|
||||
const midX = (paddedMin.x + paddedMax.x) / 2;
|
||||
@ -178,9 +178,9 @@ export class HandleGeometry {
|
||||
const min = boundingBox.minimumWorld;
|
||||
const max = boundingBox.maximumWorld;
|
||||
|
||||
// Apply padding
|
||||
const paddedMin = min.subtract(new Vector3(padding, padding, padding));
|
||||
const paddedMax = max.add(new Vector3(padding, padding, padding));
|
||||
// Apply padding to position handles inward from bounding box edges
|
||||
const paddedMin = min.add(new Vector3(padding, padding, padding));
|
||||
const paddedMax = max.subtract(new Vector3(padding, padding, padding));
|
||||
|
||||
// Calculate midpoints
|
||||
const midX = (paddedMin.x + paddedMax.x) / 2;
|
||||
|
||||
@ -135,14 +135,10 @@ export class ResizeGizmoVisuals {
|
||||
const min = boundingBox.minimumWorld;
|
||||
const max = boundingBox.maximumWorld;
|
||||
|
||||
// Calculate padding
|
||||
const padding = HandleGeometry.calculatePadding(
|
||||
boundingBox,
|
||||
this._config.current.boundingBoxPadding
|
||||
);
|
||||
|
||||
const paddedMin = min.subtract(new Vector3(padding, padding, padding));
|
||||
const paddedMax = max.add(new Vector3(padding, padding, padding));
|
||||
// Use original bounding box without padding for wireframe
|
||||
// (handles are now positioned inside, so box matches actual mesh bounds)
|
||||
const paddedMin = min;
|
||||
const paddedMax = max;
|
||||
|
||||
// Create line points for bounding box edges
|
||||
const points = [
|
||||
|
||||
Loading…
Reference in New Issue
Block a user