Modificato aggiornamento dimensioni sottoaree
This commit is contained in:
@@ -335,6 +335,28 @@ namespace WebWindowComplex.Models
|
||||
if (countAbsolute == sash.SashList.Count)
|
||||
{
|
||||
double sum = sash.SashList.Sum(x => x.dDimension);
|
||||
if (sash.ParentArea is Frame)
|
||||
{
|
||||
Frame? frame = sash.m_ParentWindow.AreaList.FirstOrDefault();
|
||||
if (frame != null)
|
||||
dim = dim + frame.ElementDimensionList.ElementAt(1).dOverlap
|
||||
+ frame.ElementDimensionList.Last().dOverlap;
|
||||
}
|
||||
else if (sash.ParentArea.ParentArea is Split && split.SplitVertList.Count > 0)
|
||||
{
|
||||
Frame? frame = sash.m_ParentWindow.AreaList.FirstOrDefault();
|
||||
int indexSplit = sash.ParentArea.ParentArea.AreaList.IndexOf(sash.ParentArea) == 0 ? 0 : sash.ParentArea.ParentArea.AreaList.IndexOf(sash.ParentArea) - 1;
|
||||
string nameProfile = "";
|
||||
if (split.ElemDimVertList.ElementAt(indexSplit).sName == "" ||
|
||||
string.Join("_", split.ElemDimVertList.ElementAt(indexSplit).sName.Split('_').Skip(1)).Equals("Mixed_Split"))
|
||||
nameProfile = "Mixed_Split_Top";
|
||||
else
|
||||
nameProfile = string.Join("_", split.ElemDimVertList.ElementAt(indexSplit).sName.Split('_').Skip(1));
|
||||
string overlapName = nameProfile + "_Overlap";
|
||||
if (frame != null)
|
||||
dim = dim + Window.m_ParameterList.GetValueOrDefault(overlapName)
|
||||
+ frame.ElementDimensionList.Last().dOverlap;
|
||||
}
|
||||
if (sash.bIsDimensionLight)
|
||||
{
|
||||
dim = dim - sash.SashList.First().ElementDimensionList.ElementAt(1).dDimension
|
||||
@@ -346,27 +368,10 @@ namespace WebWindowComplex.Models
|
||||
+ sash.SashList[i].ElementDimensionList.Last().dOverlap;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 1; i < sash.SashList.Count; i++)
|
||||
dim = dim + sash.SashList[i].ElementDimensionList.Last().dOverlap
|
||||
+ sash.SashList.First().ElementDimensionList.Last().dOverlap;
|
||||
}
|
||||
double res = dim - sum;
|
||||
if (res > 0)
|
||||
foreach (var sashDim in sash.SashList)
|
||||
{
|
||||
foreach (var sashDim in sash.SashList)
|
||||
{
|
||||
sashDim.SetDimension(sashDim.dDimension + res / countAbsolute);
|
||||
}
|
||||
}
|
||||
else if (res < 0)
|
||||
{
|
||||
foreach (var sashDim in sash.SashList)
|
||||
{
|
||||
// Sommo perchè res è negativo
|
||||
sashDim.SetDimension(sashDim.dDimension + res / countAbsolute);
|
||||
}
|
||||
sashDim.SetDimension(sashDim.dDimension + res / countAbsolute);
|
||||
}
|
||||
}
|
||||
else if (countAbsolute < sash.SashList.Count && countPercentage != sash.SashList.Count && countProportional != sash.SashList.Count)
|
||||
@@ -404,20 +409,9 @@ namespace WebWindowComplex.Models
|
||||
sum = sum + splitList.Sum(x => x.dDimension);
|
||||
double res = 0;
|
||||
res = dim - sum;
|
||||
if (res > 0)
|
||||
foreach (var item in splitList)
|
||||
{
|
||||
foreach (var item in splitList)
|
||||
{
|
||||
item.SetDimension(item.dDimension + res / countAbsolute);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var item in splitList)
|
||||
{
|
||||
// Sommo perchè res è negativo
|
||||
item.SetDimension(item.dDimension + res / countAbsolute);
|
||||
}
|
||||
item.SetDimension(item.dDimension + res / countAbsolute);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user