Skip to content

Commit

Permalink
fix(cropper): remove mergeDeep
Browse files Browse the repository at this point in the history
  • Loading branch information
Enlcxx committed Oct 7, 2024
1 parent 88d90a8 commit 20375f8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lib/image-cropper/image-cropper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
AfterViewInit
} from '@angular/core';
import {
mergeDeep,
LY_COMMON_STYLES,
ThemeVariables,
lyl,
Expand Down Expand Up @@ -476,8 +475,8 @@ export class LyImageCropper implements OnInit, AfterViewInit, OnDestroy {
return this._config;
}
set config(val: ImgCropperConfig) {
this._config = mergeDeep({}, new ImgCropperConfig(), val);
this._initialConfig = mergeDeep({}, this._config);
this._config = {...{}, ...new ImgCropperConfig(), ...val};
this._initialConfig = {...{}, ...this._config};
this._initialAreaWidth = this.config.width;
this._initialAreaHeight = this.config.height;
if (
Expand Down Expand Up @@ -1390,7 +1389,7 @@ export class LyImageCropper implements OnInit, AfterViewInit, OnDestroy {
*/
crop(config?: ImgCropperConfig): ImgCropperEvent {
const newConfig = config
? mergeDeep({ }, this.config || new ImgCropperConfig(), config) : this.config;
? {...{ }, ...(this.config || new ImgCropperConfig()), ...config} : this.config;
// this._loadImageToCanvas(this._mainImage.nativeElement);
const cropEvent = this._imgCrop(newConfig);
this.cd.markForCheck();
Expand Down

0 comments on commit 20375f8

Please sign in to comment.