diff options
author | bob <bcz@cs.brown.edu> | 2019-01-30 09:45:15 -0500 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-01-30 09:45:15 -0500 |
commit | 13518146c955f012a6f6cd2b802f80aeeffcd58d (patch) | |
tree | 7b5c52ceefc6c3dbbd7c80f54900f8c5ad7db6e0 /src/DocumentDecorations.tsx | |
parent | 8ce38637c0a8ebb8aab936aec2ee46d5833e7b3b (diff) |
docking for top-level only
Diffstat (limited to 'src/DocumentDecorations.tsx')
-rw-r--r-- | src/DocumentDecorations.tsx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/DocumentDecorations.tsx b/src/DocumentDecorations.tsx index d71cda539..1cf875ea5 100644 --- a/src/DocumentDecorations.tsx +++ b/src/DocumentDecorations.tsx @@ -3,6 +3,7 @@ import React = require("react"); import { SelectionManager } from "./util/SelectionManager"; import { observer } from "mobx-react"; import './DocumentDecorations.scss' +import { CollectionFreeFormView } from "./views/collections/CollectionFreeFormView"; @observer export class DocumentDecorations extends React.Component { @@ -20,12 +21,13 @@ export class DocumentDecorations extends React.Component { @computed get Bounds(): { x: number, y: number, b: number, r: number } { return SelectionManager.SelectedDocuments().reduce((bounds, element) => { + if (element.props.ContainingCollectionView != undefined && + !(element.props.ContainingCollectionView instanceof CollectionFreeFormView)) { + return bounds; + } var spt = element.TransformToScreenPoint(0, 0); var bpt = element.TransformToScreenPoint(element.width, element.height); - if (spt.ScreenX == undefined || spt.ScreenY == undefined || - bpt.ScreenX == undefined || bpt.ScreenY == undefined) - return { x: bounds.x, y: bounds.y, r: bounds.r, b: bounds.b }; - else return { + return { x: Math.min(spt.ScreenX, bounds.x), y: Math.min(spt.ScreenY, bounds.y), r: Math.max(bpt.ScreenX, bounds.r), b: Math.max(bpt.ScreenY, bounds.b) } |