diff options
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
-rw-r--r-- | src/client/views/DocumentDecorations.tsx | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index dc5839bdd..3782a8878 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -627,22 +627,15 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P return SelectionManager.Views().length > 1 ? '-multiple-' : '-unset-'; } - @computed get hasIcons() { - return SelectionManager.Views().some(docView => docView.rootDoc.layout_fieldKey === 'layout_icon'); - } - @computed get rotCenter() { - if (SelectionManager.Views().length) { - const seldocview = SelectionManager.Views()[0]; - const loccenter = Utils.rotPt( - NumCast(seldocview.rootDoc.rotation_centerX) * NumCast(seldocview.layoutDoc._width), - NumCast(seldocview.rootDoc.rotation_centerY) * NumCast(seldocview.layoutDoc._height), - (NumCast(seldocview.rootDoc._rotation) / 180) * Math.PI - ); - return seldocview.props + const lastView = SelectionManager.Views().lastElement(); + if (lastView) { + const seldoc = lastView.layoutDoc; + const loccenter = Utils.rotPt(NumCast(seldoc.rotation_centerX) * NumCast(seldoc._width), NumCast(seldoc.rotation_centerY) * NumCast(seldoc._height), lastView.props.ScreenToLocalTransform().Rotate); + return lastView.props .ScreenToLocalTransform() .inverse() - .transformPoint(loccenter.x + NumCast(seldocview.layoutDoc._width) / 2, loccenter.y + NumCast(seldocview.layoutDoc._height) / 2); + .transformPoint(loccenter.x + NumCast(seldoc._width) / 2, loccenter.y + NumCast(seldoc._height) / 2); } return this._rotCenter; } |