Modificato calcolo dimensione proporzionale
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<tr>
|
||||
@for (int j = 0; j < maxCol; j++)
|
||||
{
|
||||
var index = RowCollapsedDict.Keys.Where(k => k <= i).LastOrDefault();
|
||||
var index = RowCollapsedDict.Keys.Order().Where(k => k <= i).LastOrDefault();
|
||||
@if ((RowCollapsedDict.ContainsValue(true) && RowCollapsedDict.GetValueOrDefault(index))
|
||||
&& i - 1 > 0 && ItemTableList.ElementAt(i).Col > ItemTableList.ElementAt(index-1).Col){
|
||||
continue;
|
||||
|
||||
@@ -204,12 +204,29 @@ namespace WebWindowComplex.Models
|
||||
absoluteValue.Add(item.CalculateAbsoluteValue(itemList, widthTot));
|
||||
}
|
||||
int numProportional = itemList.Where(x => x.SelMeasureType == MeasureTypes.PROPORTIONAL).Count();
|
||||
if(itemList.Count > 2 && numProportional == itemList.Count - 1)
|
||||
if(numProportional > 1)
|
||||
{
|
||||
int inedMin = absoluteValue.IndexOf(absoluteValue.Min());
|
||||
var mcd = CalculateMCD(absoluteValue.ElementAt(indexArea), absoluteValue.ElementAt(inedMin));
|
||||
itemList.ElementAt(inedMin).SetDimension(absoluteValue.ElementAt(inedMin) / mcd);
|
||||
itemList.ElementAt(indexArea).SetDimension(absoluteValue.ElementAt(indexArea) / mcd);
|
||||
List<double> mcdList = new List<double>();
|
||||
foreach(var elem in itemList.Where(x => x.SelMeasureType == MeasureTypes.PROPORTIONAL).ToList())
|
||||
{
|
||||
mcdList.Add(CalculateMCD(absoluteValue.ElementAt(indexArea), absoluteValue.ElementAt(itemList.IndexOf(elem))));
|
||||
}
|
||||
int mcdDuplicati = mcdList.GroupBy(n => n)
|
||||
.Where(g => g.Count() > 1)
|
||||
.Select(g => g.Key)
|
||||
.Count();
|
||||
if (mcdList.Contains(1) || mcdDuplicati < mcdList.Count - 1)
|
||||
return ans;
|
||||
else
|
||||
{
|
||||
for(int i = 0; i < itemList.Count; i++)
|
||||
ans.ElementAt(i).SetDimension(absoluteValue.ElementAt(i) / mcdList.FirstOrDefault());
|
||||
}
|
||||
|
||||
//int inedMin = absoluteValue.IndexOf(absoluteValue.Min());
|
||||
//var mcd = CalculateMCD(absoluteValue.ElementAt(indexArea), absoluteValue.ElementAt(inedMin));
|
||||
//itemList.ElementAt(inedMin).SetDimension(absoluteValue.ElementAt(inedMin) / mcd);
|
||||
//itemList.ElementAt(indexArea).SetDimension(absoluteValue.ElementAt(indexArea) / mcd);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -449,7 +449,14 @@ namespace WebWindowComplex.Models
|
||||
// else
|
||||
// overlap = m_Parent.SashList.ElementAt(index).ElementDimensionList.Last().dOverlap;
|
||||
//}
|
||||
m_dDimension = ad.ConvertDimension(newDimensions, SelMeasureType, newType, widthTot, nSashId - 1);
|
||||
if (newType is MeasureTypes.PROPORTIONAL)
|
||||
{
|
||||
newDimensions = ad.CalculatePropVal(newDimensions, nSashId - 1, widthTot);
|
||||
for (int i = 0; i < newDimensions.Count; i++)
|
||||
m_Parent.SashList.ElementAt(i).SetDimension(newDimensions.ElementAt(i).dDimension);
|
||||
}
|
||||
else
|
||||
m_dDimension = ad.ConvertDimension(newDimensions, SelMeasureType, newType, widthTot, nSashId - 1);
|
||||
SelMeasureType = (MeasureTypes)value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,8 +46,12 @@ namespace WebWindowComplex.Models
|
||||
double dimensionTot = 0;
|
||||
List<SplitDimension> dimensions = new List<SplitDimension>();
|
||||
Frame frame = m_Parent.ParentWindow.AreaList.FirstOrDefault() ?? new Frame(null, Parent.ParentWindow);
|
||||
int subAreaVert = m_Parent.ElemDimVertList.Min(x => x.nSubArea);
|
||||
int subAreaHoriz = m_Parent.ElemDimHorizList.Min(x => x.nSubArea);
|
||||
int subAreaVert = -1;
|
||||
int subAreaHoriz = -1;
|
||||
if (m_Parent.ElemDimVertList.Count > 0)
|
||||
subAreaVert = m_Parent.ElemDimVertList.Min(x => x.nSubArea);
|
||||
if (m_Parent.ElemDimHorizList.Count > 0)
|
||||
subAreaHoriz = m_Parent.ElemDimHorizList.Min(x => x.nSubArea);
|
||||
double width = CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension;
|
||||
foreach (var item in m_Parent.ElemDimVertList.Where(x=>x.nSubArea == subAreaVert))
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>3.1.3.518</Version>
|
||||
<Version>3.1.3.611</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione Configurazioni avanzate Window per LUX</Description>
|
||||
@@ -296,6 +296,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>3.1.3.518</Version>
|
||||
<Version>3.1.3.611</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione JWD per LUX</Description>
|
||||
@@ -238,6 +238,19 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user