void DrawingView::SetAddLineToolActive(bool state/*= true*/)
{
- if (state && toolAction == NULL)
+ if (state)// && toolAction == NULL)
{
+ if (toolAction)
+ delete toolAction;
+
+ addCircleTool = false;
toolAction = new DrawLineAction();
connect(toolAction, SIGNAL(ObjectReady(Object *)), this,
SLOT(AddNewObjectToDocument(Object *)));
}
- else if (!state && toolAction)
+ else if (!state && addLineTool && toolAction)
{
delete toolAction;
toolAction = NULL;
void DrawingView::SetAddCircleToolActive(bool state/*= true*/)
{
- if (state && toolAction == NULL)
+ if (state)// && toolAction == NULL)
{
+ if (toolAction)
+ delete toolAction;
+
+ addLineTool = false;
toolAction = new DrawCircleAction();
connect(toolAction, SIGNAL(ObjectReady(Object *)), this,
SLOT(AddNewObjectToDocument(Object *)));
}
- else if (!state && toolAction)
+ else if (!state && addCircleTool && toolAction)
{
delete toolAction;
toolAction = NULL;
addCircleTool = state;
update();
-//printf("DrawingView::SetAddLineToolActive(). toolAction=%08X\n", toolAction);
+//printf("DrawingView::SetAddCircleToolActive(). toolAction=%08X\n", toolAction);
}
void DrawingView::AddNewObjectToDocument(Object * object)