Tuesday, 16 March 2010

Guess who's back?

Managed to get some time this week to pick this project up again. Getting there! Now got zoom working for both the view and the mouse controller, a few gray areas for me cleared up but I'm storing info in the Model now because it needs to be referenced by the Controller and the View, even though you could argue the View is the thing that should be worried about coordinates etc. Anyway, in the past now, decisions made.

Working on getting proper bounds checking in place for when objects are moved about, i.e. setting the margins up and not moving an object outside those bounds. Tricky bit is the point at which the mouse is pressed is within the rectangle which defines the object, not the top left corner so lots of offset arithmetic which makes it all looks complicated, and confuddles my brain trying to work it all out. It will happen though.

Current question is by having each graphic item expose its boundary so the code which moves things around can decide whether it's a good thing or not to move it, is fine for adornments whose constraints are the edge of the margins. For notes etc, they will be constrained by bar alignment, so I suspect there'll be more rewriting coming up when those challenges reveal themselves!!

No comments:

Post a Comment