ding-image-editor 3.15.4 → 3.15.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for TOAST UI Image Editor v3.15.3
1
+ // Type definitions for TOAST UI Image Editor v3.15.5
2
2
  // TypeScript Version: 3.2.2
3
3
 
4
4
  declare namespace tuiImageEditor {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ding-image-editor",
3
- "version": "3.15.4",
3
+ "version": "3.15.5",
4
4
  "description": "TOAST UI ImageEditor",
5
5
  "keywords": [
6
6
  "nhn",
@@ -488,6 +488,7 @@ class Text extends Component {
488
488
  * @private
489
489
  */
490
490
  _onFabricSelect(fEvent) {
491
+ console.log('ssssssss')
491
492
  this.isPrevEditing = true;
492
493
 
493
494
  this.setSelectedInfo(fEvent.target, true);
@@ -505,11 +506,11 @@ class Text extends Component {
505
506
  return;
506
507
  }
507
508
 
508
- if (this.isPrevEditing) {
509
- this.isPrevEditing = false;
509
+ // if (this.isPrevEditing) {
510
+ // this.isPrevEditing = false;
510
511
 
511
- return;
512
- }
512
+ // return;
513
+ // }
513
514
 
514
515
  this._fireAddText(fEvent);
515
516
  }
@@ -666,8 +666,8 @@ class Zoom extends Component {
666
666
  _addScrollBar() {
667
667
  const canvas = this.getCanvas();
668
668
 
669
- canvas.add(this._horizontalScroll);
670
- canvas.add(this._verticalScroll);
669
+ // canvas.add(this._horizontalScroll);
670
+ // canvas.add(this._verticalScroll);
671
671
 
672
672
  if (this.scrollBarTid) {
673
673
  clearTimeout(this.scrollBarTid);
@@ -132,6 +132,8 @@ class Graphics {
132
132
  */
133
133
  this._componentMap = {};
134
134
 
135
+ this._zoomLevel = 1;
136
+
135
137
  /**
136
138
  * fabric event handlers
137
139
  * @type {Object.<string, function>}
@@ -462,6 +464,7 @@ class Graphics {
462
464
  const zoom = this.getComponent(components.ZOOM);
463
465
 
464
466
  zoom.zoom({ x, y }, zoomLevel);
467
+ this._zoomLevel = zoomLevel
465
468
  }
466
469
 
467
470
  /**
@@ -584,9 +587,21 @@ class Graphics {
584
587
  canvasImage = this.canvasImage;
585
588
  }
586
589
 
587
- const { width, height } = canvasImage.getBoundingRect();
590
+ let { width, height } = canvasImage.getBoundingRect();
591
+
592
+ if(this._zoomLevel!==1){
593
+ width= width/this._zoomLevel
594
+ height= height/this._zoomLevel
595
+ }
596
+
597
+ console.log('adjustimage',width,height)
598
+
599
+ console.log('adjustmax',this.cssMaxWidth,this.cssMaxHeight)
600
+
601
+ // 修改了 _calcMaxDimension
588
602
  const maxDimension = this._calcMaxDimension(width, height);
589
603
 
604
+ console.log('maxDimension',maxDimension)
590
605
  this.setCanvasCssDimension({
591
606
  width: '100%',
592
607
  height: '100%', // Set height '' for IE9
@@ -1046,8 +1061,10 @@ class Graphics {
1046
1061
  _calcMaxDimension(width, height) {
1047
1062
  const wScaleFactor = this.cssMaxWidth / width;
1048
1063
  const hScaleFactor = this.cssMaxHeight / height;
1049
- let cssMaxWidth = Math.min(width, this.cssMaxWidth);
1050
- let cssMaxHeight = Math.min(height, this.cssMaxHeight);
1064
+ // let cssMaxWidth = Math.min(width, this.cssMaxWidth);
1065
+ // let cssMaxHeight = Math.min(height, this.cssMaxHeight);
1066
+ let cssMaxWidth = this.cssMaxWidth;
1067
+ let cssMaxHeight = this.cssMaxHeight;
1051
1068
 
1052
1069
  if (wScaleFactor < 1 && wScaleFactor < hScaleFactor) {
1053
1070
  cssMaxWidth = width * wScaleFactor;
@@ -972,6 +972,7 @@ class ImageEditor {
972
972
  * });
973
973
  */
974
974
  rotate(angle, isSilent) {
975
+ console.log('isSilent',isSilent)
975
976
  return this._rotate('rotate', angle, isSilent);
976
977
  }
977
978