fix: #2390 [Preview]缩小后scale为负值 (#2391)

This commit is contained in:
tnnevol 2022-11-17 23:51:34 +08:00 committed by GitHub
parent c5713c75ec
commit 4e16438494
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -141,8 +141,16 @@
}
//
function scaleFunc(num: number) {
//
const MIN_SCALE = 0.02;
//
const GRA = 0.1;
if (imgState.imgScale <= 0.2 && num < 0) return;
imgState.imgScale += num;
imgState.imgScale += num * GRA;
// scale < 0
if (imgState.imgScale < 0) {
imgState.imgScale = MIN_SCALE;
}
}
//