Skip to content

Commit

Permalink
Fix stepper (didi#735)
Browse files Browse the repository at this point in the history
* fix(stepper): 修复已 - 或者 . 开头时,显示不正确的问题

fix didi#731

* fix(image-processor): 修复iOS相机拍摄图片变形的问题

fix didi#734
  • Loading branch information
zouhangwithsweet authored Apr 2, 2021
1 parent 3d34b43 commit 359be23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion components/image-reader/image-processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,11 @@ function makeCanvas(img, orientation, maxWidth, maxHeight, quality) {
ctx.drawImage(img, 0, 0, width, height)
}
} else {
ctx.drawImage(img, 0, 0, width, height)
if ('5678'.includes(orientation)) {
ctx.drawImage(img, 0, 0, height, width)
} else {
ctx.drawImage(img, 0, 0, width, height)
}
}

if ((UA.oldIOS || UA.oldAndroid || UA.mQQBrowser || !navigator.userAgent) && window.JPEGEncoder) {
Expand Down
2 changes: 1 addition & 1 deletion components/stepper/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export default {
},
$_formatNum(value) {
// @elist
value = String(value).replace(/[^0-9.-]/g, '')
value = String(value).replace(/[^0-9.-]|^-|^\./g, '')
return value === '' ? 0 : this.isInteger ? Math.floor(value) : +value
},
$_getCurrentNum(value) {
Expand Down

0 comments on commit 359be23

Please sign in to comment.