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/dist/tui-image-editor.css +1 -1
- package/dist/tui-image-editor.js +69 -8
- 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/shape.js +6 -0
- package/src/js/component/text.js +3 -1
- package/src/js/component/zoom.js +40 -1
package/index.d.ts
CHANGED
package/package.json
CHANGED
@@ -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);
|
package/src/js/component/text.js
CHANGED
@@ -488,7 +488,7 @@ class Text extends Component {
|
|
488
488
|
* @private
|
489
489
|
*/
|
490
490
|
_onFabricSelect(fEvent) {
|
491
|
-
console.log('
|
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: {
|
package/src/js/component/zoom.js
CHANGED
@@ -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
|
-
|
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
|
/**
|