diff options
| author | Monika Hedman <monika_hedman@brown.edu> | 2019-02-12 16:27:45 -0500 |
|---|---|---|
| committer | Monika Hedman <monika_hedman@brown.edu> | 2019-02-12 16:27:45 -0500 |
| commit | 39a61758f87f59366a3464b72fdf249a39a78955 (patch) | |
| tree | 3bdcb59110a7eedfef3215439e77a09c1eeee0b4 /src/client/views/DocumentDecorations.tsx | |
| parent | 05a710e2a541a07347d1626489a1811874126c79 (diff) | |
| parent | 6ef7d8f10b2ec78491b66ea4e2f6cebce3b0230a (diff) | |
Merge branch 'transforms' of https://github.com/browngraphicslab/Dash-Web into hedmanLocal
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
| -rw-r--r-- | src/client/views/DocumentDecorations.tsx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index 7efaa5533..85b44307f 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -25,11 +25,12 @@ export class DocumentDecorations extends React.Component { !(element.props.ContainingCollectionView instanceof CollectionFreeFormView)) { return bounds; } - var spt = element.TransformToScreenPoint(0, 0); - var bpt = element.TransformToScreenPoint(element.width, element.height); + let transform = element.getTransform().inverse(); + var [sptX, sptY] = transform.transformPoint(0, 0); + var [bptX, bptY] = transform.transformDirection(element.width, element.height); 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) + x: Math.min(sptX, bounds.x), y: Math.min(sptY, bounds.y), + r: Math.max(bptX, bounds.r), b: Math.max(bptY, bounds.b) } }, { x: Number.MAX_VALUE, y: Number.MAX_VALUE, r: Number.MIN_VALUE, b: Number.MIN_VALUE }); } |
