diff options
author | bobzel <zzzman@gmail.com> | 2022-10-18 11:06:38 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2022-10-18 11:06:38 -0400 |
commit | f42d592381c657b9aa57408ec7b1b35c035dd20c (patch) | |
tree | 1d5fa1c6b870e23d1228740b06baa2a5e6e7039d | |
parent | b772fb95bb2f980f91da44d1442f52c4fb0b6eac (diff) |
hide rotate center by default
-rw-r--r-- | src/client/views/DocumentDecorations.tsx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index 8f66eaca7..91fb4e4df 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -388,7 +388,7 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P this._isRotating = false; rotateUndo?.end(); }), // upEvent - emptyFunction + action(e => (this._showRotCenter = !this._showRotCenter)) // clickEvent ); }; @@ -636,6 +636,7 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P return SelectionManager.Views().some(docView => docView.rootDoc.layoutKey === 'layout_icon'); } + @observable _showRotCenter = false; @observable _rotCenter = [0, 0]; @computed get rotCenter() { if (SelectionManager.Views().length) { @@ -833,12 +834,14 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P <IconButton icon={<FaUndo />} isCircle={true} hoverStyle={'lighten'} backgroundColor={Colors.DARK_GRAY} color={Colors.LIGHT_GRAY} /> </div> </div> - <div - className="documentDecorations-rotationCenter" - style={{ transform: `translate(${this.rotCenter[0] - 3}px, ${this.rotCenter[1] - 3}px)` }} - onPointerDown={this.onRotateCenterDown} - onContextMenu={e => e.preventDefault()} - /> + {!this._showRotCenter ? null : ( + <div + className="documentDecorations-rotationCenter" + style={{ transform: `translate(${this.rotCenter[0] - 3}px, ${this.rotCenter[1] - 3}px)` }} + onPointerDown={this.onRotateCenterDown} + onContextMenu={e => e.preventDefault()} + /> + )} </> )} </div> |