react-rnd
Advanced tools
Comparing version 10.3.3 to 10.3.4
@@ -326,3 +326,3 @@ 'use strict'; | ||
var hasBottom = dir.startsWith("bottom"); | ||
if (hasLeft && this.resizable) { | ||
if ((hasLeft || hasTop) && this.resizable) { | ||
var max = (selfLeft - boundaryLeft) / scale + this.resizable.size.width; | ||
@@ -332,7 +332,7 @@ this.setState({ maxWidth: max > Number(maxWidth) ? maxWidth : max }); | ||
// INFO: To set bounds in `lock aspect ratio with bounds` case. See also that story. | ||
if (hasRight || (this.props.lockAspectRatio && !hasLeft)) { | ||
if (hasRight || (this.props.lockAspectRatio && !hasLeft && !hasTop)) { | ||
var max = offsetWidth + (boundaryLeft - selfLeft) / scale; | ||
this.setState({ maxWidth: max > Number(maxWidth) ? maxWidth : max }); | ||
} | ||
if (hasTop && this.resizable) { | ||
if ((hasTop || hasLeft) && this.resizable) { | ||
var max = (selfTop - boundaryTop) / scale + this.resizable.size.height; | ||
@@ -344,3 +344,3 @@ this.setState({ | ||
// INFO: To set bounds in `lock aspect ratio with bounds` case. See also that story. | ||
if (hasBottom || (this.props.lockAspectRatio && !hasTop)) { | ||
if (hasBottom || (this.props.lockAspectRatio && !hasTop && !hasLeft)) { | ||
var max = offsetHeight + (boundaryTop - selfTop) / scale; | ||
@@ -347,0 +347,0 @@ this.setState({ |
@@ -320,3 +320,3 @@ import { createElement, PureComponent } from 'react'; | ||
var hasBottom = dir.startsWith("bottom"); | ||
if (hasLeft && this.resizable) { | ||
if ((hasLeft || hasTop) && this.resizable) { | ||
var max = (selfLeft - boundaryLeft) / scale + this.resizable.size.width; | ||
@@ -326,7 +326,7 @@ this.setState({ maxWidth: max > Number(maxWidth) ? maxWidth : max }); | ||
// INFO: To set bounds in `lock aspect ratio with bounds` case. See also that story. | ||
if (hasRight || (this.props.lockAspectRatio && !hasLeft)) { | ||
if (hasRight || (this.props.lockAspectRatio && !hasLeft && !hasTop)) { | ||
var max = offsetWidth + (boundaryLeft - selfLeft) / scale; | ||
this.setState({ maxWidth: max > Number(maxWidth) ? maxWidth : max }); | ||
} | ||
if (hasTop && this.resizable) { | ||
if ((hasTop || hasLeft) && this.resizable) { | ||
var max = (selfTop - boundaryTop) / scale + this.resizable.size.height; | ||
@@ -338,3 +338,3 @@ this.setState({ | ||
// INFO: To set bounds in `lock aspect ratio with bounds` case. See also that story. | ||
if (hasBottom || (this.props.lockAspectRatio && !hasTop)) { | ||
if (hasBottom || (this.props.lockAspectRatio && !hasTop && !hasLeft)) { | ||
var max = offsetHeight + (boundaryTop - selfTop) / scale; | ||
@@ -341,0 +341,0 @@ this.setState({ |
{ | ||
"name": "react-rnd", | ||
"version": "10.3.3", | ||
"version": "10.3.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "title": "react-rnd", |
128059