Browse Source

Fix drag and drop for animation events

ShiroSmith 6 years ago
parent
commit
0f403cdca5
1 changed files with 2 additions and 2 deletions
  1. 2 2
      hide/view/Model.hx

+ 2 - 2
hide/view/Model.hx

@@ -648,8 +648,8 @@ class Model extends FileView {
 									buildTimeline();
 									buildEventPanel();
 								case EMove:
-									var newFrame = Math.round(( (curPos + e.relX * dragIcon.scaleX) / W) * obj.currentAnimation.frameCount);
-									if( newFrame >= 0 && newFrame < events.length ) {
+									var newFrame = Math.round(( (curPos + (e.relX - 2.5) * dragIcon.scaleX ) / W ) * obj.currentAnimation.frameCount);
+									if( newFrame >= 0 && newFrame <= obj.currentAnimation.frameCount ) {
 										events[curFrame].remove(event);
 										if(events[newFrame] == null) 
 											events[newFrame] = [];