Created
October 20, 2009 15:54
-
-
Save etgryphon/214366 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dragUpdated: function(drag, evt) { | |
var loc = drag.get('location'); | |
var offset = drag.get('ghostOffset'); | |
var ghostView = drag.get('ghostView'); | |
var view = drag.get('view'); | |
var frame; | |
// if(drag.get('startFrame')){ | |
// frame = drag.get('startFrame'); | |
// } | |
// else{ | |
var pv = ghostView.get('parentView'), thisFrame = ghostView.get('frame'); // FIXME: [MB] compute these frames only once to optimize | |
frame = pv ? pv.convertFrameToView(thisFrame, null) : thisFrame; // FIXME: [MB] compute these frames only once to optimize | |
// } | |
//console.log('drag loc x: %@ y: %@'.fmt(loc.x, loc.y)); | |
loc.x -= offset.x; | |
loc.y -= offset.y; | |
// console.log('ghostView frame x: %@ y: %@'.fmt(frame.x, frame.y)); | |
// console.log('offset x: %@ y: %@'.fmt(offset.x, offset.y)); | |
loc.x += offset.x; | |
loc.y += offset.y; | |
drag.set('location', loc); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment