Canvas: Update new element type with rotation (#85690)

This commit is contained in:
Adela Almasan 2024-04-11 14:36:33 -06:00 committed by GitHub
parent 5cfca8dbf6
commit eb86fd867f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 13 additions and 0 deletions

View File

@ -126,6 +126,7 @@ export const buttonItem: CanvasElementItem<ButtonConfig, ButtonData> = {
height: options?.placement?.height ?? 78,
top: options?.placement?.top ?? 100,
left: options?.placement?.left ?? 100,
rotation: options?.placement?.rotation ?? 0,
},
}),

View File

@ -99,6 +99,7 @@ export const cloudItem: CanvasElementItem = {
height: options?.placement?.height ?? 70,
top: options?.placement?.top,
left: options?.placement?.left,
rotation: options?.placement?.rotation ?? 0,
},
}),

View File

@ -93,6 +93,7 @@ export const droneFrontItem: CanvasElementItem = {
height: options?.placement?.height ?? 26,
top: options?.placement?.top,
left: options?.placement?.left,
rotation: options?.placement?.rotation ?? 0,
},
}),

View File

@ -92,6 +92,7 @@ export const droneSideItem: CanvasElementItem = {
height: options?.placement?.height ?? 26,
top: options?.placement?.top,
left: options?.placement?.left,
rotation: options?.placement?.rotation ?? 0,
},
}),

View File

@ -106,6 +106,7 @@ export const ellipseItem: CanvasElementItem<CanvasElementConfig, CanvasElementDa
height: options?.placement?.height ?? 138,
top: options?.placement?.top,
left: options?.placement?.left,
rotation: options?.placement?.rotation ?? 0,
},
}),

View File

@ -79,6 +79,7 @@ export const iconItem: CanvasElementItem<IconConfig, IconData> = {
height: options?.placement?.height ?? 100,
top: options?.placement?.top ?? 100,
left: options?.placement?.left ?? 100,
rotation: options?.placement?.rotation ?? 0,
},
}),

View File

@ -174,6 +174,7 @@ export const metricValueItem: CanvasElementItem<TextConfig, TextData> = {
height: options?.placement?.height,
top: options?.placement?.top ?? 100,
left: options?.placement?.left ?? 100,
rotation: options?.placement?.rotation ?? 0,
},
}),

View File

@ -99,6 +99,7 @@ export const parallelogramItem: CanvasElementItem = {
height: options?.placement?.height ?? 150,
top: options?.placement?.top,
left: options?.placement?.left,
rotation: options?.placement?.rotation ?? 0,
},
}),

View File

@ -80,6 +80,7 @@ export const serverItem: CanvasElementItem<ServerConfig, ServerData> = {
height: options?.placement?.height ?? 100,
top: options?.placement?.top,
left: options?.placement?.left,
rotation: options?.placement?.rotation ?? 0,
},
config: {
type: ServerType.Single,

View File

@ -146,6 +146,7 @@ export const textItem: CanvasElementItem<TextConfig, TextData> = {
height: options?.placement?.height ?? 100,
top: options?.placement?.top,
left: options?.placement?.left,
rotation: options?.placement?.rotation ?? 0,
},
}),

View File

@ -100,6 +100,7 @@ export const triangleItem: CanvasElementItem = {
height: options?.placement?.height ?? 138,
top: options?.placement?.top,
left: options?.placement?.left,
rotation: options?.placement?.rotation ?? 0,
},
}),

View File

@ -90,6 +90,7 @@ export const windTurbineItem: CanvasElementItem = {
height: options?.placement?.height ?? 155,
top: options?.placement?.top,
left: options?.placement?.left,
rotation: options?.placement?.rotation ?? 0,
},
}),

View File

@ -436,6 +436,7 @@ export class Scene {
// Setup rotatable
rotatable: allowChanges,
throttleRotate: 5,
rotationPosition: ['top', 'right'],
// Setup snappable
snappable: allowChanges,