Tuesday, July 3, 2012

Line constraints fixes

Today I realised there was a problem with the way the shapes are mapped to the parameters array and had to revert some of the code commited after the 1.6.6 release. The problem is that by mapping the shapes and their points, the order of the points returned from the DocumentToSolverAdapter is lost and the Solver doesn't update the correct values.

I've reverted to the initial code, where the points are stored and the constraint shapes reference the points, and fixed the lines constraints. I've made a list of all the checks for line constraints and recorded the current behaviour for all of them:

- a rectangle can be rotated and resized by dragging a corner
- we can add constraints to existing lines:
    * parallel
    * perpendicular
    * horizontal
    * vertical
    * equal length
    * collinear
- after drawing two parallel lines, any of them can be moved/resized by dragging any of the points
- after drawing parallel lines and fixing a point (adding a constraint point) dragging the other point causes the other line to be updated so that the constraint is maintained.

No comments: