The Shoebox. A place for lil' apps to live in peace and harmony.

I moded the shoes sample draw.rb just a bit. I call it Sketchers. You could use it to draw something like the characters (from _whys NKS) on this wonderful shoebox site. The app could definitely use some refactoring.


Speak now or forever hold your peace:

kevinc
February 22, 2008

if you hadn’t asked for a refactor i would keep my nose out .. but i’d be interested to see what more experienced rubyists would change in addition!

Jesse
February 22, 2008

Current feedback, v1.0 refactored .. observations made on WinXP Bugs: “star” drawing style appears to draw the star at (2x, 2y) or twice the distance from upper left of window as where the mouse is. Other tools work ok. “Clear” temporarily erases the whole contents of the window. taking an action such as drawing or window resizing causes toolbar to reappear and everything continues normally. This might be a shoes bug?

kevinc
February 22, 2008

hmm, OS X has the same bug with the star. we must be using it incorrectly.

however in OS X “clear” just resets everything immediately, not needing another stimulus to do a redraw. i agree it is probably a shoes bug.

another bug in OS X: clicking any of the buttons causes it to start drawing until i click down and up again elsewhere.

tjbell
February 22, 2008

Thanks for the refactoring. I just put up a slightly different version.

Jesse
February 23, 2008

Alrighty, bug behavior has changed for the better in refmod. :)

press clear on winXP .. instead of everything going white and buttons dissapearing, the drawing field goes black and the buttons stay put. As before, resize or beginning to draw resets things to normal.

Star problem feexed.

This app will benefit from Why_’s planned shoes upgrade for drawing surfaces. Right now every “point” drawn is a piece of geometry so the more you draw the more things slow down. Drawing to some kind of a raster canvas will do away with such concerns. :)


How do I use this?