Tuesday, July 12, 2005

Tuesday 12th

Tonight's session saw me tackling a task which had never worked properly since it was added many moons ago. In theory, the system seemed fairly straightforward: when the user holds Shift, it constrains lines to 90 or 45 degrees, and constrains boxes to a perfect square.

After delving in with a brain full of caffeine, I managed to track down the problem which was causing unpredictable results - it stemmed from the fact that a line/box is not always drawn from top-left to bottom-right; sometimes, the box is drawn in reverse. Once my code understood this, the routine worked like a dream. Getting this functionality to work with Brush grabbing will be another matter!