ding-image-editor 3.15.6 → 3.15.7

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.5
1
+ // Type definitions for TOAST UI Image Editor v3.15.6
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.6",
3
+ "version": "3.15.7",
4
4
  "description": "TOAST UI ImageEditor",
5
5
  "keywords": [
6
6
  "nhn",
@@ -226,7 +226,6 @@ export default class Shape extends Component {
226
226
 
227
227
  this._bindEventOnShape(shapeObj);
228
228
 
229
- shapeObj.hasControls = false;
230
229
  shapeObj.hasBorders = false;
231
230
 
232
231
  console.log('shapObe',shapeObj)
@@ -488,7 +488,7 @@ class Text extends Component {
488
488
  * @private
489
489
  */
490
490
  _onFabricSelect(fEvent) {
491
- console.log('ssssssss')
491
+ console.log('sssssssddddddds')
492
492
  this.isPrevEditing = true;
493
493
 
494
494
  this.setSelectedInfo(fEvent.target, true);
@@ -525,6 +525,8 @@ class Text extends Component {
525
525
  const e = fEvent.e || {};
526
526
  const originPointer = this.getCanvas().getPointer(e);
527
527
 
528
+ console.log('_fireAddText')
529
+
528
530
  if (!obj) {
529
531
  this.fire(events.ADD_TEXT, {
530
532
  originPosition: {
@@ -576,15 +576,34 @@ class Zoom extends Component {
576
576
 
577
577
  const halfWidth = Math.floor(bounding.width/2);
578
578
  const left = Math.floor(Math.abs(bounding.left))
579
- if((bounding.left<0 && deltaX>0 && Math.abs(deltaX) > Math.abs(deltaY)) || (deltaX <0 && left< halfWidth && Math.abs(deltaX) > Math.abs(deltaY)) ){
579
+ // 左移动
580
+ if(bounding.left<0 && deltaX>0 && Math.abs(deltaX) > Math.abs(deltaY) ){
580
581
  this._movePointOfZoom({ x: deltaX, y: 0 });
581
582
  }
582
-
583
+ else if( bounding.left>0 && deltaX>0 && Math.abs(deltaX) > Math.abs(deltaY) ){
584
+ this._movePointOfZoom({ x: -bounding.left, y: 0 });
585
+ }
583
586
 
587
+ // 右移动
588
+ if(left< halfWidth && deltaX <0 && Math.abs(deltaX) > Math.abs(deltaY) ){
589
+ this._movePointOfZoom({ x: deltaX, y: 0 });
590
+ }else if(left >halfWidth && deltaX <0 && Math.abs(deltaX) > Math.abs(deltaY) ){
591
+ this._movePointOfZoom({ x: left-halfWidth, y: 0 });
592
+ }
593
+
594
+ // 上移动
584
595
  const halfHeight = Math.floor(bounding.height/2);
585
596
  const top = Math.floor(Math.abs(bounding.top))
586
- if((bounding.top<0 && deltaY>0 && Math.abs(deltaX) < Math.abs(deltaY) ) ||(top<halfHeight && deltaY<0 && Math.abs(deltaX) < Math.abs(deltaY) ) ){
597
+ if(bounding.top<0 && deltaY>0 && Math.abs(deltaX) < Math.abs(deltaY) ){
598
+ this._movePointOfZoom({ x: 0, y: deltaY });
599
+ }else if(bounding.top>0 && deltaY>0 && Math.abs(deltaX) < Math.abs(deltaY)){
600
+ this._movePointOfZoom({ x: 0, y: -bounding.top });
601
+ }
602
+ // 下移动
603
+ if(top<halfHeight && deltaY<0 && Math.abs(deltaX) < Math.abs(deltaY)){
587
604
  this._movePointOfZoom({ x: 0, y: deltaY });
605
+ }else if(top>halfHeight && deltaY<0 && Math.abs(deltaX) < Math.abs(deltaY)){
606
+ this._movePointOfZoom({ x: 0, y: top-halfHeight });
588
607
  }
589
608
  }
590
609