From 7249f3f2bd12794ca86775853aee700e398eeb00 Mon Sep 17 00:00:00 2001
From: vellichora <fangrui_tong@brown.edu>
Date: Sun, 2 Feb 2020 16:13:23 -0500
Subject: started creating upload from web on mobile

---
 src/mobile/MobileInkOverlay.tsx | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

(limited to 'src/mobile/MobileInkOverlay.tsx')

diff --git a/src/mobile/MobileInkOverlay.tsx b/src/mobile/MobileInkOverlay.tsx
index 5efc7b83a..600e8a91b 100644
--- a/src/mobile/MobileInkOverlay.tsx
+++ b/src/mobile/MobileInkOverlay.tsx
@@ -1,6 +1,6 @@
 import React = require('react');
 import { observer } from "mobx-react";
-import { MobileInkOverlayContent, GestureContent, UpdateMobileInkOverlayPosition } from "../server/Message";
+import { MobileInkOverlayContent, GestureContent, UpdateMobileInkOverlayPositionContent } from "../server/Message";
 import { observable, action } from "mobx";
 import { GestureUtils } from "../pen-gestures/GestureUtils";
 import "./MobileInkOverlay.scss";
@@ -37,17 +37,19 @@ export default class MobileInkOverlay extends React.Component {
     initMobileInkOverlay(content: MobileInkOverlayContent) {
         const { width, height } = content;
         const scaledSize = this.initialSize(width ? width : 0, height ? height : 0);
-        this._width = scaledSize.width * .5;
-        this._height = scaledSize.height * .5;
-        this._scale = .5; //scaledSize.scale;
+        this._width = scaledSize.width * .8;
+        this._height = scaledSize.height * .8;
+        this._scale = .8; //scaledSize.scale;
         this._x = 300; // TODO: center on screen
         this._y = 25; // TODO: center on screen
     }
 
     @action
-    updatePosition(content: UpdateMobileInkOverlayPosition) {
+    updatePosition(content: UpdateMobileInkOverlayPositionContent) {
         const { dx, dy, dsize } = content;
-        console.log(dx, dy, dsize);
+        if (dx) this._x += dx;
+        if (dy) this._y += dy;
+        // TODO: scale dsize
     }
 
     drawStroke = (content: GestureContent) => {
@@ -82,7 +84,6 @@ export default class MobileInkOverlay extends React.Component {
 
     @action
     dragStart = (e: React.PointerEvent) => {
-        console.log("pointer down");
         document.removeEventListener("pointermove", this.dragging);
         document.removeEventListener("pointerup", this.dragEnd);
         document.addEventListener("pointermove", this.dragging);
-- 
cgit v1.2.3-70-g09d2

