|
@@ -182,7 +182,7 @@ namespace SketchAssistant
|
|
//Start the redraw mode
|
|
//Start the redraw mode
|
|
redrawAss = new RedrawAssistant(leftLineList);
|
|
redrawAss = new RedrawAssistant(leftLineList);
|
|
UpdateSizes();
|
|
UpdateSizes();
|
|
- overlayItems = redrawAss.Tick(currentCursorPosition, rightLineList, -1);
|
|
|
|
|
|
+ overlayItems = redrawAss.Tick(currentCursorPosition, rightLineList, -1, false);
|
|
RedrawRightImage();
|
|
RedrawRightImage();
|
|
this.Refresh();
|
|
this.Refresh();
|
|
}
|
|
}
|
|
@@ -255,7 +255,7 @@ namespace SketchAssistant
|
|
default:
|
|
default:
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- overlayItems = redrawAss.Tick(currentCursorPosition, rightLineList, -1);
|
|
|
|
|
|
+ overlayItems = redrawAss.Tick(currentCursorPosition, rightLineList, -1, false);
|
|
RedrawRightImage();
|
|
RedrawRightImage();
|
|
}
|
|
}
|
|
historyOfActions.MoveAction(true);
|
|
historyOfActions.MoveAction(true);
|
|
@@ -285,7 +285,7 @@ namespace SketchAssistant
|
|
default:
|
|
default:
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- overlayItems = redrawAss.Tick(currentCursorPosition, rightLineList, -1);
|
|
|
|
|
|
+ overlayItems = redrawAss.Tick(currentCursorPosition, rightLineList, -1, false);
|
|
RedrawRightImage();
|
|
RedrawRightImage();
|
|
}
|
|
}
|
|
UpdateButtonStatus();
|
|
UpdateButtonStatus();
|
|
@@ -339,7 +339,7 @@ namespace SketchAssistant
|
|
newLine.PopulateMatrixes(isFilledMatrix, linesMatrix);
|
|
newLine.PopulateMatrixes(isFilledMatrix, linesMatrix);
|
|
historyOfActions.AddNewAction(new SketchAction(SketchAction.ActionType.Draw, newLine.GetID()));
|
|
historyOfActions.AddNewAction(new SketchAction(SketchAction.ActionType.Draw, newLine.GetID()));
|
|
//Execute a RedrawAssistant tick with the currently finished Line
|
|
//Execute a RedrawAssistant tick with the currently finished Line
|
|
- overlayItems = redrawAss.Tick(currentCursorPosition, rightLineList, newLine.GetID());
|
|
|
|
|
|
+ overlayItems = redrawAss.Tick(currentCursorPosition, rightLineList, newLine.GetID(), true);
|
|
RedrawRightImage();
|
|
RedrawRightImage();
|
|
}
|
|
}
|
|
UpdateButtonStatus();
|
|
UpdateButtonStatus();
|
|
@@ -365,7 +365,7 @@ namespace SketchAssistant
|
|
{
|
|
{
|
|
redrawAss = new RedrawAssistant(leftLineList);
|
|
redrawAss = new RedrawAssistant(leftLineList);
|
|
UpdateSizes();
|
|
UpdateSizes();
|
|
- overlayItems = redrawAss.Tick(currentCursorPosition, rightLineList, -1);
|
|
|
|
|
|
+ overlayItems = redrawAss.Tick(currentCursorPosition, rightLineList, -1, false);
|
|
RedrawRightImage();
|
|
RedrawRightImage();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -390,8 +390,8 @@ namespace SketchAssistant
|
|
Line drawline = new Line(currentLine);
|
|
Line drawline = new Line(currentLine);
|
|
drawline.DrawLine(rightGraph);
|
|
drawline.DrawLine(rightGraph);
|
|
pictureBoxRight.Image = rightImage;
|
|
pictureBoxRight.Image = rightImage;
|
|
- //RedrawTick
|
|
|
|
- overlayItems = redrawAss.Tick(currentCursorPosition, rightLineList, -1);
|
|
|
|
|
|
+ //Redraw overlay gets ticked
|
|
|
|
+ overlayItems = redrawAss.Tick(currentCursorPosition, rightLineList, rightLineList.Count, false);
|
|
RedrawRightImage();
|
|
RedrawRightImage();
|
|
}
|
|
}
|
|
//Deleting
|
|
//Deleting
|
|
@@ -409,8 +409,8 @@ namespace SketchAssistant
|
|
rightLineList[lineID] = new Tuple<bool, Line>(false, rightLineList[lineID].Item2);
|
|
rightLineList[lineID] = new Tuple<bool, Line>(false, rightLineList[lineID].Item2);
|
|
}
|
|
}
|
|
RepopulateDeletionMatrixes();
|
|
RepopulateDeletionMatrixes();
|
|
- //RedrawTick
|
|
|
|
- overlayItems = redrawAss.Tick(currentCursorPosition, rightLineList, -1);
|
|
|
|
|
|
+ //Redraw overlay gets ticked
|
|
|
|
+ overlayItems = redrawAss.Tick(currentCursorPosition, rightLineList, -1, false);
|
|
RedrawRightImage();
|
|
RedrawRightImage();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -429,7 +429,16 @@ namespace SketchAssistant
|
|
/// <returns>The new canvas</returns>
|
|
/// <returns>The new canvas</returns>
|
|
private Image GetEmptyCanvas(int width, int height)
|
|
private Image GetEmptyCanvas(int width, int height)
|
|
{
|
|
{
|
|
- Image image = new Bitmap(width, height);
|
|
|
|
|
|
+ Image image;
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ image = new Bitmap(width, height);
|
|
|
|
+ }
|
|
|
|
+ catch(ArgumentException e)
|
|
|
|
+ {
|
|
|
|
+ ShowInfoMessage("The requested canvas size caused an error: \n" + e.ToString() + "\n The Canvas will be set to match your window.");
|
|
|
|
+ image = new Bitmap(pictureBoxLeft.Width, pictureBoxLeft.Height);
|
|
|
|
+ }
|
|
Graphics graph = Graphics.FromImage(image);
|
|
Graphics graph = Graphics.FromImage(image);
|
|
graph.FillRectangle(Brushes.White, 0, 0, width + 10, height + 10);
|
|
graph.FillRectangle(Brushes.White, 0, 0, width + 10, height + 10);
|
|
return image;
|
|
return image;
|