aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-10-26 21:03:46 -0400
committerbobzel <zzzman@gmail.com>2021-10-26 21:03:46 -0400
commitc7aea59ca8cd24bf218be581ea241670fee6cc49 (patch)
tree8f3122e1e57e4e0ad142832eb3c85fe5f8a92fe2 /src
parent2330035b84c2d3475e0e1e7644a68008c048e0b4 (diff)
use center of selection bounds for rotation if more than one stroke is selected.
Diffstat (limited to 'src')
-rw-r--r--src/client/views/DocumentDecorations.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 3b2661145..522995479 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -63,14 +63,15 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number, P
@computed
get Bounds() {
- return SelectionManager.Views().map(dv => dv.getBounds()).reduce((bounds, rect) =>
+ const views = SelectionManager.Views();
+ return views.map(dv => dv.getBounds()).reduce((bounds, rect) =>
!rect ? bounds :
{
x: Math.min(rect.left, bounds.x),
y: Math.min(rect.top, bounds.y),
r: Math.max(rect.right, bounds.r),
b: Math.max(rect.bottom, bounds.b),
- c: rect.center
+ c: views.length === 1 ? rect.center : undefined
},
{ x: Number.MAX_VALUE, y: Number.MAX_VALUE, r: Number.MIN_VALUE, b: Number.MIN_VALUE, c: undefined as ({ X: number, Y: number } | undefined) });
}