From 3b72be402eabc8c3f82bfa2db8d33b714bee572a Mon Sep 17 00:00:00 2001 From: SillyLossy Date: Mon, 29 May 2023 01:18:11 +0300 Subject: [PATCH] Don't let cropper overflow the canvas (or upload fails) --- public/script.js | 1 + public/style.css | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/public/script.js b/public/script.js index cfe0dcdba..8770dede0 100644 --- a/public/script.js +++ b/public/script.js @@ -4476,6 +4476,7 @@ function callPopup(text, type, inputValue = '') { $('#avatarToCrop').cropper({ aspectRatio: 2 / 3, autoCropArea: 1, + viewMode: 2, rotatable: false, crop: function (event) { crop_data = event.detail; diff --git a/public/style.css b/public/style.css index eea08718f..09fecffd6 100644 --- a/public/style.css +++ b/public/style.css @@ -2797,7 +2797,7 @@ h5 { #avatarCropWrap { margin: 10px auto; max-height: 90%; - max-width: 90%; + max-width: 100%; } #avatarToCrop { @@ -4470,4 +4470,4 @@ body.waifuMode #avatar_zoom_popup { overflow-y: auto; overflow-x: hidden; } -} \ No newline at end of file +}