Skip to content

Commit

Permalink
chore: fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nd0ut committed Sep 28, 2023
1 parent 0089370 commit c1b7367
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions blocks/CloudImageEditor/src/crop-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ export function constraintRect(rect1, rect2) {
*/
function resizeNorth({ rect, delta, aspectRatio, imageBox }) {
const [, dy] = delta;
let { x, y, width, height } = rect;
let { y, width, height } = rect;

y += dy;
height -= dy;
if (aspectRatio) {
width = height * aspectRatio;
}
x = rect.x + rect.width / 2 - width / 2;
let x = rect.x + rect.width / 2 - width / 2;
if (y <= imageBox.y) {
y = imageBox.y;
height = rect.y + rect.height - y;
Expand Down Expand Up @@ -211,14 +211,14 @@ function resizeNorth({ rect, delta, aspectRatio, imageBox }) {
*/
function resizeWest({ rect, delta, aspectRatio, imageBox }) {
const [dx] = delta;
let { x, y, width, height } = rect;
let { x, width, height } = rect;

x += dx;
width -= dx;
if (aspectRatio) {
height = width / aspectRatio;
}
y = rect.y + rect.height / 2 - height / 2;
let y = rect.y + rect.height / 2 - height / 2;
if (x <= imageBox.x) {
x = imageBox.x;
width = rect.x + rect.width - x;
Expand Down Expand Up @@ -269,13 +269,13 @@ function resizeWest({ rect, delta, aspectRatio, imageBox }) {
*/
function resizeSouth({ rect, delta, aspectRatio, imageBox }) {
const [, dy] = delta;
let { x, y, width, height } = rect;
let { y, width, height } = rect;

height += dy;
if (aspectRatio) {
width = height * aspectRatio;
}
x = rect.x + rect.width / 2 - width / 2;
let x = rect.x + rect.width / 2 - width / 2;
if (y + height >= imageBox.y + imageBox.height) {
height = imageBox.y + imageBox.height - y;
if (aspectRatio) {
Expand Down Expand Up @@ -323,13 +323,13 @@ function resizeSouth({ rect, delta, aspectRatio, imageBox }) {
*/
function resizeEast({ rect, delta, aspectRatio, imageBox }) {
const [dx] = delta;
let { x, y, width, height } = rect;
let { x, width, height } = rect;

width += dx;
if (aspectRatio) {
height = width / aspectRatio;
}
y = rect.y + rect.height / 2 - height / 2;
let y = rect.y + rect.height / 2 - height / 2;
if (x + width >= imageBox.x + imageBox.width) {
width = imageBox.x + imageBox.width - x;
if (aspectRatio) {
Expand Down

0 comments on commit c1b7367

Please sign in to comment.