Aggiornato inserimento dimensioni frame con arco

This commit is contained in:
Annamaria Sassi
2025-12-02 18:19:57 +01:00
parent dfe4ecd9d1
commit ba80c4eca0
3 changed files with 97 additions and 10 deletions
+89 -8
View File
@@ -35,14 +35,95 @@ namespace WebWindowComplex.Models
{
if(m_dValue != value)
{
m_dValue = value;
if (value > MaxDim)
if (ParentFrame.SelShapeIndex == (int)Shapes.RECTANGLE ||
ParentFrame.SelShapeIndex == (int)Shapes.RIGHTCHAMFER ||
ParentFrame.SelShapeIndex == (int)Shapes.LEFTCHAMFER ||
ParentFrame.SelShapeIndex == (int)Shapes.DOUBLECHAMFER)
{
m_dValue = MaxDim;
if (value > MaxDim)
{
m_dValue = MaxDim;
}
else if (value < MinDim && !m_sName.Equals("Radius"))
{
m_dValue = MinDim;
}
else
m_dValue = value;
}
else if (value < MinDim && !m_sName.Equals("Radius"))
else
{
m_dValue = MinDim;
if (ParentFrame.SelShapeIndex == (int)Shapes.ARC_FULL)
{
var width = ParentFrame.DimensionList.First(x => x.sName.Equals("Width")).dValue;
var height = ParentFrame.DimensionList.First(x => x.sName.Equals("Height")).dValue;
if (sName.Equals("Height") && value > 0.5 * width && value < MaxDim)
{
m_dValue = value;
}
else if (sName.Equals("Width") && height > 0.5 * value && value > MinDim)
{
m_dValue = value;
}
}
else if (ParentFrame.SelShapeIndex == (int)Shapes.ARC)
{
var width = ParentFrame.DimensionList.First(x => x.sName.Equals("Width")).dValue;
var height = ParentFrame.DimensionList.First(x => x.sName.Equals("Height")).dValue;
var fullHeight = ParentFrame.DimensionList.First(x => x.sName.Equals("Full Height")).dValue;
if (sName.Equals("Full Height") && (value - height) < 0.5 * width && value < MaxDim)
{
m_dValue = value;
}
else if (sName.Equals("Height") && (fullHeight - value) < 0.5 * width && value < MaxDim)
{
m_dValue = value;
}
else if (sName.Equals("Width") && (fullHeight - height) < 0.5 * value && value < MaxDim)
{
m_dValue = value;
}
}
else if (ParentFrame.SelShapeIndex == (int)Shapes.THREECENTERARC)
{
var width = ParentFrame.DimensionList.First(x => x.sName.Equals("Width")).dValue;
var height = ParentFrame.DimensionList.First(x => x.sName.Equals("Height")).dValue;
var fullHeight = ParentFrame.DimensionList.First(x => x.sName.Equals("Full Height")).dValue;
if (sName.Equals("Full Height") && (value - height) < 0.5 * width && value < MaxDim)
{
m_dValue = value;
}
else if (sName.Equals("Height") && (fullHeight - value) < 0.5 * width && value < MaxDim)
{
m_dValue = value;
}
else if (sName.Equals("Width") && (fullHeight - height) < 0.5 * value)
{
m_dValue = value;
}
else if (sName.Equals("Radius") && value < 0.5 * width)
{
m_dValue = value;
}
}
else if (ParentFrame.SelShapeIndex == (int)Shapes.DOUBLEARC)
{
var width = ParentFrame.DimensionList.First(x => x.sName.Equals("Width")).dValue;
var height = ParentFrame.DimensionList.First(x => x.sName.Equals("Height")).dValue;
var fullHeight = ParentFrame.DimensionList.First(x => x.sName.Equals("Full Height")).dValue;
if (sName.Equals("Full Height") && (value - height) > 0.5 * width && value < MaxDim)
{
m_dValue = value;
}
else if (sName.Equals("Height") && (fullHeight - value) > 0.5 * width && value < MaxDim)
{
m_dValue = value;
}
else if (sName.Equals("Width") && (fullHeight - height) > 0.5 * value && value > MinDim)
{
m_dValue = value;
}
}
}
if (ParentFrame.AreaList.Count > 0)
SearchAreaList(ParentFrame);
@@ -87,9 +168,9 @@ namespace WebWindowComplex.Models
if (node != null)
{
if (node.AreaType.Equals(AreaTypes.SASH))
updateDimSubArea((Sash)node);
UpdateDimSubArea((Sash)node);
else if (node.AreaType.Equals(AreaTypes.SPLIT))
updateDimSubArea((Split)node);
UpdateDimSubArea((Split)node);
foreach (var item in node.AreaList)
{
SearchAreaList(item);
@@ -97,7 +178,7 @@ namespace WebWindowComplex.Models
}
}
protected void updateDimSubArea(Area area)
protected void UpdateDimSubArea(Area area)
{
if(area is Sash && sName.Equals("Width"))
{