Skip to content

Commit 7591621

Browse files
feat(View): added keybindReset prop for optional reset binding
1 parent 7a2ba32 commit 7591621

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/core/View.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export default class View extends Component {
203203
}
204204
switch (e.code) {
205205
case 'KeyR':
206-
this.resetCamera();
206+
if (props.keybindResetCamera) this.resetCamera();
207207
break;
208208
default:
209209
// console.log(e.code);
@@ -706,6 +706,7 @@ View.defaultProps = {
706706
showCubeAxes: false,
707707
pointerSize: 0,
708708
showOrientationAxes: false,
709+
keybindResetCamera: true,
709710
};
710711

711712
View.propTypes = {
@@ -860,4 +861,9 @@ View.propTypes = {
860861
* Show/Hide orientation axes.
861862
*/
862863
showOrientationAxes: PropTypes.bool,
864+
865+
/**
866+
* Trigger/Not Trigger resetcamera on KeyR
867+
*/
868+
keybindResetCamera: PropTypes.bool,
863869
};

0 commit comments

Comments
 (0)