Sunday, April 29, 2012

ZOOMING!!

YES! While just a few lines of code, this was one of the more challenging problem-solving tasks that I've had to overcome in this project. Of course, as I mentioned in the previous post, there's always a tendency to push the hard tasks off until end, (and I suspect that the single remaining big task - panning - will prove to be even tougher). Jim called it the "smart friend" approach to programming - do the easier stuff and tell yourself, "I'll just have my smart friend do that other part." Of course, eventually you end up stepping up as the smart friend, but it keeps you from freaking out in the meantime.

Actually, all this one really took was taking pencil to paper to draw out what's actually happening when you PERCEIVE the field as zooming in or out, which is, of course, simply a repositioning of the elements in the field. Once the pictures were drawn, it all came together (still took four days of thinking). It also involves that percent increase, percent decrease logic - for example, if the market drops 33.3%, it has to rise 50% to get you back where you started.

Also implemented two buttons for zoom in and zoom out, but in a most rudimentary fashion. I'll really need to create a button class to handle these at some point.

Actually, there's one more trick to be pulled off here - the implementation of a svg (scalable vector graphic) version of the Texas map and making the map grow and shrink with zoom in and zoom out functions.

No comments:

Post a Comment