This repository has been archived by the owner on Jan 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
and ViewCube camera type switch. Fixup other many functions
- Loading branch information
Владислав Чалый
committed
Feb 7, 2023
1 parent
483c422
commit d5d10bd
Showing
18 changed files
with
256 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 7 additions & 8 deletions
15
src/renderer/Main/Components/ViewChange/LockLookAtCenterApp.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,30 @@ | ||
import { IconButton, Tooltip } from '@mui/material'; | ||
import { MdCenterFocusStrong } from '@react-icons/all-files/md/MdCenterFocusStrong'; | ||
import { MdCenterFocusWeak } from '@react-icons/all-files/md/MdCenterFocusWeak'; | ||
import { useState } from 'react'; | ||
import { observer } from 'mobx-react'; | ||
import { AppStore } from '../../../AppStore'; | ||
import { config, saveConfig } from '../../../Shared/Config'; | ||
import { colors } from '../../../Shared/Config'; | ||
|
||
export const LockLookAtCenterApp = () => { | ||
const [isActive, setterIsActive] = useState(config.scene.isFixedCenter); | ||
export const LockLookAtCenterApp = observer(() => { | ||
AppStore.sceneStore.orbitControls.enablePan = !config.scene.isFixedCenter; | ||
|
||
return <Tooltip title={'look at center (doubleclick change)'} arrow placement="bottom" | ||
return <Tooltip title={'look at center. use doubleclick to lock change'} arrow placement="bottom" | ||
PopperProps={{ sx: { userSelect: 'none' } }}> | ||
<IconButton | ||
size='small' | ||
onDoubleClick={() => { | ||
config.scene.isFixedCenter = !isActive; | ||
setterIsActive(config.scene.isFixedCenter); | ||
config.scene.isFixedCenter = !config.scene.isFixedCenter; | ||
saveConfig(); | ||
AppStore.sceneStore.animate(); | ||
}} | ||
onClick={() => { | ||
AppStore.sceneStore.orbitControls.target.set(AppStore.sceneStore.gridSize.x / 2, 0, AppStore.sceneStore.gridSize.z / 2); | ||
AppStore.sceneStore.animate(); | ||
}}> | ||
{isActive | ||
{config.scene.isFixedCenter | ||
? <MdCenterFocusStrong color={colors.background.light}/> | ||
: <MdCenterFocusWeak color={colors.background.light}/>} | ||
</IconButton> | ||
</Tooltip>; | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.