Hello! I''m releasing an extraction from an application I''m currently working on. It''s a small library for dealing with points and polygons, called Polygons. It really just implements some textbook algorithms w/ Prototype-style JavaScript classes. Check it out here: http://polygons.mdaines.com/ The demo on that page (Firefox/Safari only right now) uses the point- in-polygon function and a little trickery (nothing too involved, though) to make dragging non-rectangular objects way more natural. In the application I''m working on, I combine that with the rotation functions. I don''t plan to include anything for drawing, but hey, look at this: http://brevity.org/code/google/draw.html Keep in mind that this is a skittish 0.1 release. I haven''t tested it at all yet with IE, and some of the syntax for dealing with Points and Polygons needs to be ironed out a bit. I hope someone finds it useful! -- Michael Daines http://www.mdaines.com
Nice!!! On 4/23/06, Michael Daines <michael.daines-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hello! > > I''m releasing an extraction from an application I''m currently working > on. It''s a small library for dealing with points and polygons, called > Polygons. It really just implements some textbook algorithms w/ > Prototype-style JavaScript classes. Check it out here: > > http://polygons.mdaines.com/ > > The demo on that page (Firefox/Safari only right now) uses the point- > in-polygon function and a little trickery (nothing too involved, > though) to make dragging non-rectangular objects way more natural. In > the application I''m working on, I combine that with the rotation > functions. > > I don''t plan to include anything for drawing, but hey, look at this: > > http://brevity.org/code/google/draw.html > > Keep in mind that this is a skittish 0.1 release. I haven''t tested it > at all yet with IE, and some of the syntax for dealing with Points > and Polygons needs to be ironed out a bit. > > I hope someone finds it useful! > > > -- Michael Daines > http://www.mdaines.com > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Just to let you know. The demo doesn''t work in Safari because the "drag an image" built-in drag-drop behaviour kicks in instead of your JavaScript drag-handler. Not sure how to fix it but doing an Event.stop might do it... Other than that, really cool stuff! Cheers, Jon On 4/24/06, Michael Daines <michael.daines-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello! > > I''m releasing an extraction from an application I''m currently working > on. It''s a small library for dealing with points and polygons, called > Polygons. It really just implements some textbook algorithms w/ > Prototype-style JavaScript classes. Check it out here: > > http://polygons.mdaines.com/ > > The demo on that page (Firefox/Safari only right now) uses the point- > in-polygon function and a little trickery (nothing too involved, > though) to make dragging non-rectangular objects way more natural. In > the application I''m working on, I combine that with the rotation > functions. > > I don''t plan to include anything for drawing, but hey, look at this: > > http://brevity.org/code/google/draw.html > > Keep in mind that this is a skittish 0.1 release. I haven''t tested it > at all yet with IE, and some of the syntax for dealing with Points > and Polygons needs to be ironed out a bit. > > I hope someone finds it useful! > > > -- Michael Daines > http://www.mdaines.com > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
Yes, but only sometimes... (maybe?) I use Safari, and one issue I''m aware of is that if you try to drag somewhere that isn''t in the star''s polygon shape but IS in the star''s element''s rectangle, you''ll get the default "drag an image" behaviour. This happens in Firefox too. When you click on a star''s shape and drag it, do you still get the "drag an image" behaviour? Event.stop does fix that issue, though. (Try out the demo page again and see if it does for you, too.) I thought it''d be more complicated than that. -- Michael Daines On Apr 23, 2006, at 7:28 PM, Jon Tirsen wrote:> Just to let you know. The demo doesn''t work in Safari because the > "drag an image" built-in drag-drop behaviour kicks in instead of your > JavaScript drag-handler. Not sure how to fix it but doing an > Event.stop might do it...