修复el-image大图预览的时候,拖动图片图片的移动距离和鼠标移动距离不对应

pull/22728/head
chendf 2023-11-03 19:53:16 +08:00 committed by GitHub
parent 290e68ea6a
commit d4344d78b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -137,8 +137,9 @@ export default {
const style = {
transform: `scale(${scale}) rotate(${deg}deg)`,
transition: enableTransition ? 'transform .3s' : '',
'margin-left': `${offsetX}px`,
'margin-top': `${offsetY}px`
/* fixed the margin movement distance is not correct */
'margin-left': `${offsetX * 2}px`,
'margin-top': `${offsetY * 2}px`
};
if (this.mode === Mode.CONTAIN) {
style.maxWidth = style.maxHeight = '100%';