Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { CoreComponents } from '../../lib/sdk/components'
import { useGizmoAlignment } from './useGizmoAlignment'

// gizmoManager mock
import { createGizmoManager } from '../../lib/babylon/decentraland/gizmo-manager'
import { createGizmoManager } from '../../lib/babylon/decentraland/GizmoManager'
import mitt from 'mitt'
import { renderHook } from '@testing-library/react'
import { act } from 'react-dom/test-utils'
jest.mock('../../lib/babylon/decentraland/gizmo-manager')
jest.mock('../../lib/babylon/decentraland/GizmoManager')
const createGizmoManagerMock = createGizmoManager as jest.MockedFn<typeof createGizmoManager>
const gizmoManagerEvents = mitt()
const mockEntity = 0 as Entity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export function createGizmoManager(context: SceneContext) {
}
},
getGizmoTypes() {
return [GizmoType.POSITION, GizmoType.ROTATION, GizmoType.SCALE, GizmoType.FREE] as const
return [GizmoType.FREE, GizmoType.POSITION, GizmoType.ROTATION, GizmoType.SCALE] as const
},
setGizmoType(type: GizmoType) {
// Then disable all Babylon gizmos
Expand Down Expand Up @@ -385,6 +385,14 @@ export function createGizmoManager(context: SceneContext) {
currentTransformer.setup()
currentTransformer.setEntities(selectedEntities)

// Pass GizmoManager reference to FreeGizmo for centroid calculation
if ('setGizmoManager' in currentTransformer) {
Comment thread
nicoecheza marked this conversation as resolved.
;(currentTransformer as any).setGizmoManager({
calculateCentroid,
updateGizmoPosition
})
}

// Set up callbacks for ECS updates
if ('setUpdateCallbacks' in currentTransformer) {
currentTransformer.setUpdateCallbacks(updateEntityPosition, () => {
Expand Down

This file was deleted.

Loading
Loading