Skip to content

Commit

Permalink
fix(image): Initialize rotate before switching, closes tusen-ai#921 (t…
Browse files Browse the repository at this point in the history
…usen-ai#928)

Co-authored-by: kev1nzh <[email protected]>
  • Loading branch information
2 people authored and rhengles committed Aug 31, 2021
1 parent ef2d0c3 commit 92ca4c0
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 92ca4c0

Please sign in to comment.