mirror of
https://github.com/GuerillaStudio/souvenir.git
synced 2025-01-20 15:50:20 +00:00
fix crop
This commit is contained in:
parent
3aea52350c
commit
05bb7d30ca
1 changed files with 1 additions and 1 deletions
|
@ -9,7 +9,7 @@ export function makeRectangle (x, y, width, height) {
|
|||
|
||||
export function crop ({ x, y, width: w, height: h }) {
|
||||
if (w < h) {
|
||||
return makeRectangle((h - w) / 2, y, h, h)
|
||||
return makeRectangle(x, (h - w) / 2, w, w)
|
||||
} else if (w > h) {
|
||||
return makeRectangle((w - h) / 2, y, h, h)
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue