Commit e6cd2bf542ea0cae80ac989091e4b5421f80c4f3
1 parent
2f4c317491
Exists in
master
and in
1 other branch
update version
Showing 2 changed files with 11 additions and 6 deletions Side-by-side Diff
app/index.html
app/scripts/controllers/tshirtdesign.js
| ... | ... | @@ -19,10 +19,16 @@ |
| 19 | 19 | //Custom control |
| 20 | 20 | fabric.Object.prototype.transparentCorners = false; |
| 21 | 21 | fabric.Object.prototype.hasRotatingPoint = false; |
| 22 | + | |
| 23 | + // fabric.Canvas.prototype.__onMouseDown = function (e) { | |
| 24 | + // // return false; | |
| 25 | + // }; | |
| 26 | + | |
| 22 | 27 | var ctrVisible = {tl: false, ml:false, bl:false, mb: false, br: true, mr: false, tr: true, mt: true, mtr: false}; |
| 23 | 28 | for(key in ctrVisible) { |
| 24 | 29 | fabric.Object.prototype.setControlVisible(key,ctrVisible[key]); |
| 25 | 30 | } |
| 31 | + | |
| 26 | 32 | fabric.Object.prototype.customiseCornerIcons({ |
| 27 | 33 | settings: { |
| 28 | 34 | borderColor: '#0000ff', |
| 29 | 35 | |
| 30 | 36 | |
| 31 | 37 | |
| ... | ... | @@ -45,13 +51,13 @@ |
| 45 | 51 | fabric.Canvas.prototype.customiseControls({ |
| 46 | 52 | mt: { |
| 47 | 53 | cursor: 'pointer', |
| 48 | - // action: 'remove' | |
| 49 | 54 | action: function(e, target) { |
| 50 | - currentObj = canvas.getActiveObject(); | |
| 51 | 55 | if(confirm('削除してもよろしいですか?')) { |
| 52 | - currentObj.remove(); | |
| 56 | + if (canvas.getActiveObject()) { | |
| 57 | + canvas.remove(canvas.getActiveObject()); | |
| 58 | + } | |
| 59 | + canvas.renderAll(); | |
| 53 | 60 | } |
| 54 | - | |
| 55 | 61 | } |
| 56 | 62 | }, |
| 57 | 63 | br: { |
| ... | ... | @@ -67,7 +73,6 @@ |
| 67 | 73 | // console.log('after render'); |
| 68 | 74 | }); |
| 69 | 75 | canvas.on({ |
| 70 | - 'mouse:up' : mouseUp, | |
| 71 | 76 | 'object:added' : onIllustrationAdded, |
| 72 | 77 | 'object:moving' : onIllustrationMoving, |
| 73 | 78 | 'object:scaling' : onIllustrationChange, |