Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Prevent dragging of crop div. (#4456) (#4457)
Browse files Browse the repository at this point in the history
- Also fix the width of right hand side background div.
  • Loading branch information
chenba authored and jaredhirsch committed May 24, 2018
1 parent a32a88a commit f7b8c1d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/src/pages/shot/crop-tool.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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,
Expand Down Expand Up @@ -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});
Expand Down

0 comments on commit f7b8c1d

Please sign in to comment.