Tuesday, 13 April 2010

Squashed a bug

As I add functionality, it exposes bugs in the code I started with. For example the attributes dialog for a text item was good, the implementation was tested, however it highlighted the way I was changing text attributes by using deriveFont was flawed, as it remembers the attributes from before.
Implemented the right click menu infrastructure in the software, looking good, so started writing actions, starting with one to create a new text item. Was interesting as I wasn't sure how I was going to do it from a menu item as I couldn't answer the question "how do I know where it's location should be on the page". Answer was implement a first-click infrastructure by storing an action away in the mousecontroller to execute, ie user says Insert Text, mouse cursor becomes a crosshair, next click causes configure dialog for a new text item to show at that point. Simples - I expect more bugs from this later as it gets exploited more!!

No comments:

Post a Comment