On 6-Sep-06, at 1:55 AM, Arnar Birgisson wrote: > I'd also like to see relative versions of those functions, would help > with custom dragging and resizing. I.e. adjustElementPosition(el, {x: > 0, y: -10}) would move the element 10pxls up. > > Not to be pushy, but I'd also like to see "add" and "subtract" member > functions on the dimension and coordinates objects. > > Now, this: > var delta = new MochiKit.DOM.Coordinates(e.mouse().page.x - lastpos.x, > e.mouse().page.y - > lastpos.y); > lastpos = e.mouse().page; > currelpos = elementPosition(pi.firstChild); > var newpos = new MochiKit.DOM.Coordinates(currelpos.x + delta.x, > currelpos.y + delta.y); > setElementPosition(pi.firstChild, newpos); > > would be reduced to this: > var delta = e.mouse().page.subtract(lastpos); > lastpos = e.mouse().page; > adjustElementPosition(pi.firstChild, delta); > > I'd be happy to provide patches for this if anyone else has use for > it.
Sounds reasonable, if you have a patch please do it against trunk and attach it to a trac ticket: http://trac.mochikit.com/newticket Thanks! Beau --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "MochiKit" group. To post to this group, send email to mochikit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/mochikit -~----------~----~----~----~------~----~------~--~---