aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/DocumentDecorations.tsx17
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>