mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Fix typing
This commit is contained in:
@@ -12,7 +12,7 @@ import { AffineTransformation } from '../Utils/AffineTransformation';
|
||||
|
||||
export const updateSceneToTileMapTransformation = (
|
||||
instance: gdInitialInstance,
|
||||
renderedInstance: RenderedInstance,
|
||||
renderedInstance: RenderedInstance | Rendered3DInstance,
|
||||
sceneToTileMapTransformation: AffineTransformation,
|
||||
tileMapToSceneTransformation: AffineTransformation
|
||||
): ?{ scaleX: number, scaleY: number } => {
|
||||
@@ -20,10 +20,20 @@ export const updateSceneToTileMapTransformation = (
|
||||
let scaleX = 1,
|
||||
scaleY = 1;
|
||||
if (instance.hasCustomSize()) {
|
||||
if (
|
||||
// $FlowIgnore
|
||||
!renderedInstance.getEditableTileMap
|
||||
) {
|
||||
console.error(
|
||||
`Instance of ${instance.getObjectName()} seems to not be a RenderedSimpleTileMapInstance (method getEditableTileMap does not exist).`
|
||||
);
|
||||
return;
|
||||
}
|
||||
// $FlowIgnore
|
||||
const editableTileMap = renderedInstance.getEditableTileMap();
|
||||
if (!editableTileMap) {
|
||||
console.error(
|
||||
`Could not find the editable tile map for instance of object ${instance.getObjectName()}`
|
||||
`Could not find the editable tile map for instance of object ${instance.getObjectName()}.`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
@@ -270,6 +270,8 @@ const SwipeableDrawerEditorsDisplay = React.forwardRef<
|
||||
}
|
||||
pauseRendering={!props.isActive}
|
||||
showObjectInstancesIn3D={values.use3DEditor}
|
||||
tileMapTileSelection={props.tileMapTileSelection}
|
||||
onSelectTileMapTile={props.onSelectTileMapTile}
|
||||
/>
|
||||
</ErrorBoundary>
|
||||
<div style={styles.bottomContainer} id={swipeableDrawerContainerId}>
|
||||
@@ -358,6 +360,8 @@ const SwipeableDrawerEditorsDisplay = React.forwardRef<
|
||||
ref={instancesPropertiesEditorRef}
|
||||
unsavedChanges={props.unsavedChanges}
|
||||
historyHandler={props.historyHandler}
|
||||
tileMapTileSelection={props.tileMapTileSelection}
|
||||
onSelectTileMapTile={props.onSelectTileMapTile}
|
||||
/>
|
||||
)}
|
||||
</I18n>
|
||||
|
@@ -72,6 +72,8 @@ export const Default = () => (
|
||||
}}
|
||||
wrappedEditorRef={() => {}}
|
||||
pauseRendering={false}
|
||||
tileMapTileSelection={null}
|
||||
onSelectTileMapTile={() => {}}
|
||||
/>
|
||||
</DragAndDropContextProvider>
|
||||
</FixedHeightFlexContainer>
|
||||
|
@@ -37,6 +37,8 @@ export const InstanceSprite2d = () => (
|
||||
editInstanceVariables={action('edit instance variables')}
|
||||
onGetInstanceSize={() => [100, 101, 102]}
|
||||
onEditObjectByName={action('edit object')}
|
||||
tileMapTileSelection={null}
|
||||
onSelectTileMapTile={() => {}}
|
||||
/>
|
||||
</SerializedObjectDisplay>
|
||||
)}
|
||||
@@ -63,6 +65,8 @@ export const InstanceCube3d = () => (
|
||||
editInstanceVariables={action('edit instance variables')}
|
||||
onGetInstanceSize={() => [100, 101, 102]}
|
||||
onEditObjectByName={action('edit object')}
|
||||
tileMapTileSelection={null}
|
||||
onSelectTileMapTile={() => {}}
|
||||
/>
|
||||
</SerializedObjectDisplay>
|
||||
)}
|
||||
@@ -89,6 +93,8 @@ export const InstanceTextInput = () => (
|
||||
editInstanceVariables={action('edit instance variables')}
|
||||
onGetInstanceSize={() => [120, 40, 0]}
|
||||
onEditObjectByName={action('edit object')}
|
||||
tileMapTileSelection={null}
|
||||
onSelectTileMapTile={() => {}}
|
||||
/>
|
||||
</SerializedObjectDisplay>
|
||||
)}
|
||||
|
Reference in New Issue
Block a user