ding-image-editor 3.15.5 → 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.5",
3
+ "version": "3.15.7",
4
4
  "description": "TOAST UI ImageEditor",
5
5
  "keywords": [
6
6
  "nhn",
@@ -226,6 +226,12 @@ export default class Shape extends Component {
226
226
 
227
227
  this._bindEventOnShape(shapeObj);
228
228
 
229
+ shapeObj.hasBorders = false;
230
+
231
+ console.log('shapObe',shapeObj)
232
+ shapeObj.borderColor ='black'
233
+ console.log('shapObe',shapeObj)
234
+
229
235
  canvas.add(shapeObj).setActiveObject(shapeObj);
230
236
 
231
237
  this._resetPositionFillFilter(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: {
@@ -562,10 +562,49 @@ class Zoom extends Component {
562
562
  _onMouseMoveWithHandMode({ e }) {
563
563
  const canvas = this.getCanvas();
564
564
  const { x, y } = canvas.getPointer(e);
565
+
566
+
565
567
  const deltaX = x - this._startHandPoint.x;
566
568
  const deltaY = y - this._startHandPoint.y;
567
569
 
568
- this._movePointOfZoom({ x: deltaX, y: deltaY });
570
+ console.log('deltaX',deltaX)
571
+ console.log('deltaY',deltaY)
572
+
573
+ const canvasImage = this.getCanvasImage()
574
+ const bounding = canvasImage.getBoundingRect();
575
+ console.log( bounding)
576
+
577
+ const halfWidth = Math.floor(bounding.width/2);
578
+ const left = Math.floor(Math.abs(bounding.left))
579
+ // 左移动
580
+ if(bounding.left<0 && deltaX>0 && Math.abs(deltaX) > Math.abs(deltaY) ){
581
+ this._movePointOfZoom({ x: deltaX, y: 0 });
582
+ }
583
+ else if( bounding.left>0 && deltaX>0 && Math.abs(deltaX) > Math.abs(deltaY) ){
584
+ this._movePointOfZoom({ x: -bounding.left, y: 0 });
585
+ }
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
+ // 上移动
595
+ const halfHeight = Math.floor(bounding.height/2);
596
+ const top = Math.floor(Math.abs(bounding.top))
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)){
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 });
607
+ }
569
608
  }
570
609
 
571
610
  /**