diff options
author | bob <bcz@cs.brown.edu> | 2019-01-29 12:20:13 -0500 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-01-29 12:20:13 -0500 |
commit | ed982a553d1831353e312ae8137afa95ef84ebe5 (patch) | |
tree | 6a6510f1cfe9aaa0bef3ae071eebeb63592bb1e0 /src/DocumentDecorations.tsx | |
parent | 0402105238f24785a1229dbbb37f2e4dba958f88 (diff) |
semi working docking, but zooming is now broken.
Diffstat (limited to 'src/DocumentDecorations.tsx')
-rw-r--r-- | src/DocumentDecorations.tsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/DocumentDecorations.tsx b/src/DocumentDecorations.tsx index 7899db9c9..d5a682b82 100644 --- a/src/DocumentDecorations.tsx +++ b/src/DocumentDecorations.tsx @@ -24,7 +24,10 @@ export class DocumentDecorations extends React.Component { return SelectionManager.SelectedDocuments().reduce((bounds, element) => { var spt = element.TransformToScreenPoint(0, 0); var bpt = element.TransformToScreenPoint(element.width, element.height); - return { + 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 { 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) } |