aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/PreviewCursor.tsx2
-rw-r--r--src/client/views/collections/CollectionDockingView.tsx10
-rw-r--r--src/client/views/collections/collectionFreeForm/MarqueeView.tsx9
3 files changed, 15 insertions, 6 deletions
diff --git a/src/client/views/PreviewCursor.tsx b/src/client/views/PreviewCursor.tsx
index ff8434681..5ece034fb 100644
--- a/src/client/views/PreviewCursor.tsx
+++ b/src/client/views/PreviewCursor.tsx
@@ -18,6 +18,8 @@ export class PreviewCursor extends React.Component<{}> {
@observable public static hide = () => { };
@action
public static Show(hide: any, x: number, y: number) {
+ if (this.hide)
+ this.hide();
this.clickPoint = [x, y];
this.hide = hide;
setTimeout(action(() => this.Visible = true), (1));
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index 1ea18ed42..84159635a 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -326,8 +326,14 @@ export class DockedFrameRenderer extends React.Component<DockedFrameProps> {
Server.GetField(this.props.documentId, action((f: Opt<Field>) => this._document = f as Document));
}
- nativeWidth = () => this._document!.GetNumber(KeyStore.NativeWidth, this._panelWidth);
- nativeHeight = () => this._document!.GetNumber(KeyStore.NativeHeight, this._panelHeight);
+ nativeWidth = () => {
+ let pw = this._document!.GetNumber(KeyStore.NativeWidth, 0);
+ return pw ? pw : this._panelWidth;
+ }
+ nativeHeight = () => {
+ let pw = this._document!.GetNumber(KeyStore.NativeHeight, 0);
+ return pw ? pw : this._panelHeight;
+ }
contentScaling = () => {
let wscale = this._panelWidth / (this.nativeWidth() ? this.nativeWidth() : this._panelWidth);
if (wscale * this.nativeHeight() > this._panelHeight)
diff --git a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
index e04f89578..32633a1ed 100644
--- a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
+++ b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
@@ -69,13 +69,14 @@ export class MarqueeView extends React.Component<MarqueeViewProps>
}
@action
onPointerDown = (e: React.PointerEvent): void => {
+ this._downX = this._lastX = e.pageX;
+ this._downY = this._lastY = e.pageY;
+
+ document.removeEventListener("keypress", this.onKeyPress, false);
if ((CollectionFreeFormView.RIGHT_BTN_DRAG && e.button === 0 && !e.altKey && !e.metaKey && this.props.container.props.active()) ||
(!CollectionFreeFormView.RIGHT_BTN_DRAG && (e.button === 2 || (e.button === 0 && e.altKey)) && this.props.container.props.active())) {
- this._downX = this._lastX = e.pageX;
- this._downY = this._lastY = e.pageY;
this._used = false;
this._showOnUp = true;
- document.removeEventListener("keypress", this.onKeyPress, false);
document.addEventListener("pointermove", this.onPointerMove, true);
document.addEventListener("pointerup", this.onPointerUp, true);
document.addEventListener("keydown", this.marqueeCommand, true);
@@ -124,7 +125,7 @@ export class MarqueeView extends React.Component<MarqueeViewProps>
}
@action
- onClick = (e: MouseEvent): void => {
+ onClick = (e: React.MouseEvent): void => {
PreviewCursor.Show(this.hideCursor, e.clientX, e.clientY);
document.addEventListener("keypress", this.onKeyPress, false);
}