From f7b8c1d53e4d5ec6289be80dbb7bbd99073fb827 Mon Sep 17 00:00:00 2001 From: Barry Chen Date: Thu, 24 May 2018 13:45:09 -0500 Subject: [PATCH] Prevent dragging of crop div. (#4456) (#4457) - Also fix the width of right hand side background div. --- server/src/pages/shot/crop-tool.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/pages/shot/crop-tool.js b/server/src/pages/shot/crop-tool.js index b0da0883b9..8c9f4c506b 100644 --- a/server/src/pages/shot/crop-tool.js +++ b/server/src/pages/shot/crop-tool.js @@ -64,6 +64,7 @@ exports.CropTool = class CropTool extends React.Component { const selectionBottomPx = `${this.state.cropSelection.bottom}px`; const selectionHeightPx = `${this.state.cropSelection.height}px`; const selectionWidthPx = `${this.state.cropSelection.width}px`; + const remainingRightSideWidthPx = `${this.canvasWidth - this.state.cropSelection.right}px`; const oneHundredPercent = "100%"; const bgTopStyles = { @@ -82,7 +83,7 @@ exports.CropTool = class CropTool extends React.Component { top: selectionTopPx, height: selectionHeightPx, left: selectionRightPx, - width: oneHundredPercent + width: remainingRightSideWidthPx }; const bgBottomStyles = { top: selectionBottomPx, @@ -186,6 +187,7 @@ exports.CropTool = class CropTool extends React.Component { isMousedown = true; mousedownPosition = this.captureMousePosition(e); + e.preventDefault(); if (!this.state.cropSelection) { this.setState({selectionState: SelectionState.CREATING});