ding-image-editor 3.15.5 → 3.15.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ding-image-editor",
3
- "version": "3.15.5",
3
+ "version": "3.15.6",
4
4
  "description": "TOAST UI ImageEditor",
5
5
  "keywords": [
6
6
  "nhn",
@@ -226,6 +226,13 @@ export default class Shape extends Component {
226
226
 
227
227
  this._bindEventOnShape(shapeObj);
228
228
 
229
+ shapeObj.hasControls = false;
230
+ shapeObj.hasBorders = false;
231
+
232
+ console.log('shapObe',shapeObj)
233
+ shapeObj.borderColor ='black'
234
+ console.log('shapObe',shapeObj)
235
+
229
236
  canvas.add(shapeObj).setActiveObject(shapeObj);
230
237
 
231
238
  this._resetPositionFillFilter(shapeObj);
@@ -562,10 +562,30 @@ 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
+ if((bounding.left<0 && deltaX>0 && Math.abs(deltaX) > Math.abs(deltaY)) || (deltaX <0 && left< halfWidth && Math.abs(deltaX) > Math.abs(deltaY)) ){
580
+ this._movePointOfZoom({ x: deltaX, y: 0 });
581
+ }
582
+
583
+
584
+ const halfHeight = Math.floor(bounding.height/2);
585
+ 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) ) ){
587
+ this._movePointOfZoom({ x: 0, y: deltaY });
588
+ }
569
589
  }
570
590
 
571
591
  /**