Skip to content

Commit

Permalink
refactor: improve code and add changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuanchen committed Aug 6, 2023
1 parent 4310a8e commit 3957a64
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## next

- Add `rounded` option to the `getCroppedCanvas` method (#1047).

## 1.5.13 (Nov 20, 2022)

- Add `backface-visibility: hidden` to cropper image to avoid ghost lines when moving (#982).
Expand Down
2 changes: 1 addition & 1 deletion src/js/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ export default {
y: initialY,
width: initialWidth,
height: initialHeight,
} = this.getData(!!options.rounded);
} = this.getData(options.rounded);
const ratio = source.width / Math.floor(canvasData.naturalWidth);

if (ratio !== 1) {
Expand Down
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ declare namespace Cropper {
minHeight?: number;
maxWidth?: number;
maxHeight?: number;
rounded?: boolean;
fillColor?: string;
imageSmoothingEnabled?: boolean;
imageSmoothingQuality?: ImageSmoothingQuality;
rounded?: boolean;
}

export interface SetDataOptions {
Expand Down

0 comments on commit 3957a64

Please sign in to comment.