fixed #4418: Make sure to use currently selected shape tool when updating shape options

This commit is contained in:
Jaex 2020-01-16 18:44:01 +03:00
parent ffbb4f33f0
commit 661d9e3668
2 changed files with 25 additions and 8 deletions

View file

@ -113,6 +113,26 @@ public ShapeType CurrentTool
}
}
public ShapeType CurrentShapeTool
{
get
{
ShapeType tool = CurrentTool;
if (tool == ShapeType.ToolSelect)
{
BaseShape shape = CurrentShape;
if (shape != null)
{
tool = shape.ShapeType;
}
}
return tool;
}
}
public Rectangle CurrentRectangle
{
get

View file

@ -324,7 +324,7 @@ internal void CreateToolbar()
{
Form.Pause();
ShapeType shapeType = CurrentTool;
ShapeType shapeType = CurrentShapeTool;
Color borderColor;
@ -378,7 +378,7 @@ internal void CreateToolbar()
{
Form.Pause();
ShapeType shapeType = CurrentTool;
ShapeType shapeType = CurrentShapeTool;
Color fillColor;
@ -457,7 +457,7 @@ internal void CreateToolbar()
tslnudBorderSize.Content.Maximum = 20;
tslnudBorderSize.Content.ValueChanged = (sender, e) =>
{
ShapeType shapeType = CurrentTool;
ShapeType shapeType = CurrentShapeTool;
int borderSize = (int)tslnudBorderSize.Content.Value;
@ -487,7 +487,7 @@ internal void CreateToolbar()
tslnudCornerRadius.Content.Maximum = 150;
tslnudCornerRadius.Content.ValueChanged = (sender, e) =>
{
ShapeType shapeType = CurrentTool;
ShapeType shapeType = CurrentShapeTool;
if (shapeType == ShapeType.RegionRectangle)
{
@ -1263,10 +1263,7 @@ private void UpdateMenu()
}
// use menu of current shape in case of an active select tool.
if (CurrentShape != null && shapeType == ShapeType.ToolSelect)
{
shapeType = CurrentShape.ShapeType;
}
shapeType = CurrentShapeTool;
Color borderColor;