Welcome to Atalasoft Community Sign in | Help

Picky, Picky, Picky

Don't expect a lot of depth to this.  I just wanted to say that I'm super picky, especially about off-by-one pixel errors.  I used to hand-draw all my own icons and UI elements making sure everything was pixel perfect, and I really want the tools that I use to have the attention to detail that I like to put into my own work.

Here is a shot taken from Visual Studio 2003, a tool I use daily:



I highlighted the trouble spot.  Sure, it's only one pixel off and is probably a result of a minor bug in the tab renderer in the workspace, but dang that drives me nuts.

Instead of just complaining, I'm going to talk about how to never make that kind of bug, ever.  Be formal about your coordinate system and/or your drawing canvas.  Make a mock-up of what you want your UI layout to be and start giving things names and attach labels to them.  Imagine that you had to give the drawing to someone else to make out of wood and they would need a parts list or a cutting diagram for the parts.  Imagine further that someone else would be responsible for assembling those parts into the finished picture.

When you formalize and name things, then your code to realize the UI will start to look like assembly instructions (paint the upper gutter, paint the horizontal swatch, paint the list of projects) and not a clumsy set of r.Offset(curr, 0, 5) calls.

Years ago I looked at code written by Bryan K. Ressler (Beaker) at Adobe for floating windoids.  These were palette windows that floated in a layer above the document layer.  While the code was a little on the sloppy side, one thing that stood out was that he never, ever, drew a pixel twice.  He had laid out exactly what pixels needed to be painted under which circumstances and hit only the ones that needed that.  This used to be a key element to making a responsive UI - wasting cycles with redundant painting makes everything soupy.
Published Wednesday, November 08, 2006 10:10 AM by Steve Hawley

Comments

No Comments
Anonymous comments are disabled