Commit c674a36080280e4de326cdc1ed548b83ce7434fa
1 parent
360762e8c7
Exists in
master
and in
1 other branch
fix delete effect
Showing 3 changed files with 8 additions and 5 deletions Side-by-side Diff
app/index.html
app/scripts/controllers/tshirtdesign.js
| ... | ... | @@ -216,10 +216,12 @@ |
| 216 | 216 | object.setCoords(); |
| 217 | 217 | var Coords = object.oCoords; |
| 218 | 218 | var diffX = 55, diffY=50; |
| 219 | - $('#object-border-left').css({'height':object.originalState.height*object.scaleY, top: Coords.tl.y+diffY, left: Coords.tl.x+diffX}); | |
| 220 | - $('#object-border-right').css({'height':object.originalState.height*object.scaleY, top: Coords.tr.y+diffY, left: Coords.tr.x+diffX}); | |
| 221 | - $('#object-border-top').css({'width':object.originalState.width*object.scaleX, top: Coords.tl.y+diffY, left: Coords.tl.x+diffX}); | |
| 222 | - $('#object-border-bottom').css({'width':object.originalState.width*object.scaleX, top: Coords.bl.y+diffY, left: Coords.bl.x+diffX}); | |
| 219 | + var xAngle = Math.cos(object.getAngle() * (Math.PI / 180))/2; | |
| 220 | + var yAngle = Math.sin(object.getAngle() * (Math.PI / 180))/2; | |
| 221 | + $('#object-border-left').css({'height':Math.ceil(object.originalState.height*object.scaleY), top: Coords.tl.y+diffY, left: Coords.tl.x+diffX}); | |
| 222 | + $('#object-border-right').css({'height':Math.ceil(object.originalState.height*object.scaleY), top: Coords.tr.y+diffY, left: Coords.tr.x+diffX}); | |
| 223 | + $('#object-border-top').css({'width':Math.ceil(object.originalState.width*object.scaleX), top: Coords.tl.y+diffY, left: Coords.tl.x+diffX}); | |
| 224 | + $('#object-border-bottom').css({'width':Math.ceil(object.originalState.width*object.scaleX), top: Coords.bl.y+diffY, left: Coords.bl.x+diffX}); | |
| 223 | 225 | $('.object-border').css({ |
| 224 | 226 | '-ms-transform': 'rotate('+object.getAngle()+'deg)', /* IE 9 */ |
| 225 | 227 | '-webkit-transform': 'rotate('+object.getAngle()+'deg)', /* Safari */ |