diff options
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) } |