[Igarden-commit] Garden/source/PlanTool PathTool.cpp,1.9,1.9.2.1
Status: Beta
Brought to you by:
jlbedell
|
From: Jeffrey B. <jlb...@us...> - 2007-01-17 13:18:27
|
Update of /cvsroot/igarden/Garden/source/PlanTool In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv25688 Modified Files: Tag: Release_branch_v1 PathTool.cpp Log Message: BUG: Fix problem undoing changes to the end point of an arc Index: PathTool.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/PlanTool/PathTool.cpp,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** PathTool.cpp 21 Jun 2006 02:45:57 -0000 1.9 --- PathTool.cpp 17 Jan 2007 13:18:25 -0000 1.9.2.1 *************** *** 160,168 **** planRectangle_t PathTool::ChangeIndexedAnchorPoint(UInt32 index, planPoint_t oldPoint, planPoint_t newPoint, Element *elem, bool start, PlanMoveAction *action) { ! planPoint_t beforeMove; beforeMove = elem->GetIndexedAnchorPoint(index); ! action->MoveAnchorBy(index, newPoint.xOffset-beforeMove.xOffset, newPoint.yOffset-beforeMove.yOffset ); ! return elem->ChangeIndexedAnchorPoint(index, newPoint); } --- 160,175 ---- planRectangle_t PathTool::ChangeIndexedAnchorPoint(UInt32 index, planPoint_t oldPoint, planPoint_t newPoint, Element *elem, bool start, PlanMoveAction *action) { ! planPoint_t beforeMove, afterMove; ! planRectangle_t result; + // Since ChangeIndexAnchorPoint() may constrain the anchor point, the code shouldn't compare + // a current mouse position to the last constrained point. Therefore, do the operation, then + // get the new constrained point to do the comparison. + // ex: End point of arc must lie on the radius beforeMove = elem->GetIndexedAnchorPoint(index); ! result = elem->ChangeIndexedAnchorPoint(index, newPoint); ! afterMove = elem->GetIndexedAnchorPoint(index); ! action->MoveAnchorBy(index, afterMove.xOffset-beforeMove.xOffset, afterMove.yOffset-beforeMove.yOffset ); ! return result; } |