diff options
| author | bobzel <zzzman@gmail.com> | 2019-02-12 21:08:04 -0500 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2019-02-12 21:08:04 -0500 |
| commit | e09ddf280d0e2bdef28477a6d7be06c57051dab6 (patch) | |
| tree | 34843e07ff2fbcae30c9a534b3beb4e89590dca4 /src/client/views/DocumentDecorations.tsx | |
| parent | 7a93f60c9529e5d175e617fc7c07145a9b33e572 (diff) | |
fixed up nested selections and scaling
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..cc43372af 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -4,6 +4,7 @@ import { SelectionManager } from "../util/SelectionManager"; import { observer } from "mobx-react"; import './DocumentDecorations.scss' import { CollectionFreeFormView } from "./collections/CollectionFreeFormView"; +import { KeyStore } from '../../fields/Key' @observer export class DocumentDecorations extends React.Component { @@ -25,8 +26,8 @@ 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); + var spt = element.TransformToScreenPoint(0, 0, 1, 0, 0, false); + var bpt = element.TransformToScreenPoint(element.width, element.height, 1, 0, 0, false); 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) @@ -109,8 +110,8 @@ export class DocumentDecorations extends React.Component { let scale = element.width / rect.width; let actualdW = Math.max(element.width + (dW * scale), 20); let actualdH = Math.max(element.height + (dH * scale), 20); - element.x += dX * (actualdW - element.width); - element.y += dY * (actualdH - element.height); + element.props.Document.SetNumber(KeyStore.X, element.props.Document.GetNumber(KeyStore.X, 0) + dX * (actualdW - element.width)); + element.props.Document.SetNumber(KeyStore.Y, element.props.Document.GetNumber(KeyStore.Y, 0) + dY * (actualdH - element.height)); if (Math.abs(dW) > Math.abs(dH)) element.width = actualdW; else |
