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/dist/tui-image-editor.css +1 -1
- package/dist/tui-image-editor.js +25 -12
- package/dist/tui-image-editor.min.css +1 -1
- package/dist/tui-image-editor.min.js +2 -2
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/js/component/text.js +5 -4
- package/src/js/component/zoom.js +2 -2
- package/src/js/graphics.js +20 -3
- package/src/js/imageEditor.js +1 -0
package/index.d.ts
CHANGED
package/package.json
CHANGED
package/src/js/component/text.js
CHANGED
@@ -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
|
-
|
509
|
+
// if (this.isPrevEditing) {
|
510
|
+
// this.isPrevEditing = false;
|
510
511
|
|
511
|
-
|
512
|
-
}
|
512
|
+
// return;
|
513
|
+
// }
|
513
514
|
|
514
515
|
this._fireAddText(fEvent);
|
515
516
|
}
|
package/src/js/component/zoom.js
CHANGED
@@ -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);
|
package/src/js/graphics.js
CHANGED
@@ -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
|
-
|
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;
|