Skip to content

Commit

Permalink
fix(image): Initialize rotate before switching, closes #921 (#928)
Browse files Browse the repository at this point in the history
Co-authored-by: kev1nzh <kev1nzh@app-ark.com>
  • Loading branch information
kev1nzh37 and kev1nzh committed Aug 20, 2021
1 parent efa6484 commit 4d6f28e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## Pending

### Fixes

- Fix `n-image` not initializing `rorate` after switching images, closes [#921](https://github.com/TuSimple/naive-ui/issues/921).

## 2.16.5 (2021-08-20)

### Feats
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## Pending

### Fixes

- 修复 `n-image` 切换图像后没有初始化 `rorate` 的问题,关闭 [#921](https://github.com/TuSimple/naive-ui/issues/921)

## 2.16.5 (2021-08-20)

### Feats
Expand Down
2 changes: 2 additions & 0 deletions src/image/src/ImagePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,12 @@ export default defineComponent({
let rotate = 0
function handleSwitchPrev (): void {
scale = 1
rotate = 0
props.onPrev?.()
}
function handleSwitchNext (): void {
scale = 1
rotate = 0
props.onNext?.()
}
function rotateCounterclockwise (): void {
Expand Down

0 comments on commit 4d6f28e

Please sign in to comment.