From a886e7f3243c59966759a8f383ac8fbb578ab370 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Mon, 16 Feb 2026 17:55:45 +0100 Subject: [PATCH] - Modificato calcolo altezza split group - Modificato aggiornamento dimensioni per cambio forma frame --- Test.UI/Data/AntaDoppia.jwd | 2 +- WebWindowComplex/Models/Area.cs | 29 ++++-- WebWindowComplex/Models/AreaDimension.cs | 44 +++------ WebWindowComplex/Models/ElementDimension.cs | 26 ++++++ WebWindowComplex/Models/Frame.cs | 39 ++++---- WebWindowComplex/Models/Sash.cs | 4 +- WebWindowComplex/Models/SashDimension.cs | 82 +++++++++-------- WebWindowComplex/Models/SplitDimension.cs | 90 +++++++++++++++---- WebWindowComplex/TableComp.razor.cs | 3 +- WebWindowComplex/WebWindowComplex.csproj | 43 ++++++++- .../WebWindowConfigurator.csproj | 37 +++++++- 11 files changed, 283 insertions(+), 116 deletions(-) diff --git a/Test.UI/Data/AntaDoppia.jwd b/Test.UI/Data/AntaDoppia.jwd index 4996a9a..9e2534c 100644 --- a/Test.UI/Data/AntaDoppia.jwd +++ b/Test.UI/Data/AntaDoppia.jwd @@ -111,7 +111,7 @@ "SashId": 2, "OpeningType": "TURNONLY_RIGHT", "MeasureType": "PROPORTIONAL", - "Dimension": 2, + "Dimension": 1, "HasHandle": false, "ElementDimensionList": [ { diff --git a/WebWindowComplex/Models/Area.cs b/WebWindowComplex/Models/Area.cs index 858a73f..72c2a3f 100644 --- a/WebWindowComplex/Models/Area.cs +++ b/WebWindowComplex/Models/Area.cs @@ -307,23 +307,36 @@ namespace WebWindowComplex.Models split = (Split)sash.ParentArea.ParentArea; if (sash.ParentArea is Frame || (sash.ParentArea.ParentArea is Split && split.SplitHorizList.Count > 0)) { - Frame frame = new Frame(null, null); - if(split.SplitHorizList.Count > 0) - frame = (Frame)sash.ParentArea.ParentArea.ParentArea; - else - frame = (Frame)sash.ParentArea; - foreach (var i in frame.DimensionList) - dimList.Add(new AreaDimension(i.dDimension, i.SelMeasureType, i.Parent)); + Frame? frame = sash.m_ParentWindow.AreaList.FirstOrDefault(); + if(frame != null) + { + foreach (var i in frame.DimensionList) + dimList.Add(new AreaDimension(i.dDimension, i.SelMeasureType, i.Parent)); + } } else { - //Split s = (Split)sash.ParentArea.ParentArea; foreach (var i in split.SplitVertList) dimList.Add(new AreaDimension(i.dDimension, i.SelMeasureType, i.Parent)); } if (countAbsolute == sash.SashList.Count) { double sum = sash.SashList.Sum(x => x.dDimension); + if (sash.bIsDimensionLight) + { + dim = dim - sash.SashList.First().ElementDimensionList.ElementAt(1).dDimension + - sash.SashList.First().ElementDimensionList.Last().dDimension; + for (int i = 1; i < sash.SashList.Count; i++) + { + dim = dim - sash.SashList[i].ElementDimensionList.ElementAt(1).dDimension + - sash.SashList[i].ElementDimensionList.Last().dDimension; + } + } + else + { + for (int i = 1; i < sash.SashList.Count; i++) + dim = dim + sash.SashList[i].ElementDimensionList.Last().dOverlap; + } double res = dim - sum; if (res > 0) { diff --git a/WebWindowComplex/Models/AreaDimension.cs b/WebWindowComplex/Models/AreaDimension.cs index d81f37c..4d97fb7 100644 --- a/WebWindowComplex/Models/AreaDimension.cs +++ b/WebWindowComplex/Models/AreaDimension.cs @@ -130,17 +130,8 @@ namespace WebWindowComplex.Models { if (newType.Equals(MeasureTypes.PERCENTAGE)) { - double overlapElem = 0; - if (m_Parent is Sash) - { - // Calcolo overlap - Sash s = (Sash)m_Parent; - int indElem = indexSash == 0 ? 1 : s.SashList.ElementAt(indexSash).ElementDimensionList.Count - 1; - if (!s.bIsDimensionLight) - overlapElem = s.SashList.ElementAt(indexSash).ElementDimensionList.ElementAt(indElem).dOverlap / 2; - } //return Double.Round((m_dDimension / m_Parent.Width) * 100, 1); - return ((dDimension - overlapElem) / widthTot) * 100; + return (dDimension / widthTot) * 100; } else { @@ -151,17 +142,8 @@ namespace WebWindowComplex.Models { if (newType.Equals(MeasureTypes.ABSOLUTE)) { - double overlapElem = 0; - if(m_Parent is Sash) - { - // Calcolo overlap - Sash s = (Sash)m_Parent; - int indElem = indexSash == 0 ? 1 : s.SashList.ElementAt(indexSash).ElementDimensionList.Count - 1; - if (!s.bIsDimensionLight) - overlapElem = s.SashList.ElementAt(indexSash).ElementDimensionList.ElementAt(indElem).dOverlap / 2; - } //return Double.Round(ConvertFromPropVal(newType), 2); - return ConvertFromPropVal(itemList, newType, widthTot) + overlapElem; + return ConvertFromPropVal(itemList, newType, widthTot); } else { @@ -173,17 +155,8 @@ namespace WebWindowComplex.Models { if (newType.Equals(MeasureTypes.ABSOLUTE)) { - double overlapElem = 0; - if (m_Parent is Sash) - { - // Calcolo overlap - Sash s = (Sash)m_Parent; - int indElem = indexSash == 0 ? 1 : s.SashList.ElementAt(indexSash).ElementDimensionList.Count - 1; - if (!s.bIsDimensionLight) - overlapElem = s.SashList.ElementAt(indexSash).ElementDimensionList.ElementAt(indElem).dOverlap; - } //return Double.Round((m_dDimension * m_Parent.Width) / 100, 2); - return (dDimension * widthTot) / 100 + overlapElem; + return (dDimension * widthTot) / 100; } else { @@ -282,12 +255,19 @@ namespace WebWindowComplex.Models { // Calcolo overlap Sash s = (Sash)m_Parent; - int indexSash = itemList.IndexOf(this); + int indexSash = -1; + if (this is SashDimension) + { + SashDimension sashDimCurr = (SashDimension)this; + indexSash = s.SashList.IndexOf(sashDimCurr); + } + else + indexSash = itemList.IndexOf(this); int indElem = indexSash == 0 ? 1 : s.SashList.ElementAt(indexSash).ElementDimensionList.Count - 1; if (!s.bIsDimensionLight) overlapElem = s.SashList.ElementAt(indexSash).ElementDimensionList.ElementAt(indElem).dOverlap / 2; } - return dDimension - overlapElem; + return dDimension; } case MeasureTypes.PROPORTIONAL: { diff --git a/WebWindowComplex/Models/ElementDimension.cs b/WebWindowComplex/Models/ElementDimension.cs index 7798ab5..2047e21 100644 --- a/WebWindowComplex/Models/ElementDimension.cs +++ b/WebWindowComplex/Models/ElementDimension.cs @@ -34,6 +34,32 @@ namespace WebWindowComplex.Models { if(dDimension != value) { + if(m_ParentArea is Split) + { + if (value > m_dMax) + value = m_dMax; + else if (value < m_dMin) + value = m_dMin; + Split s = (Split)m_ParentArea; + SplitElementDimension splitElem = (SplitElementDimension)this; + List elemList = new List(); + if (s.ElemDimVertList.Contains(splitElem)) + elemList = s.SplitVertList; + else if (s.ElemDimHorizList.Contains(splitElem)) + elemList = s.SplitHorizList; + if (value > m_dDimension) + { + double diff = (value - m_dDimension)/2; + elemList.ElementAt(m_nIndex - 1).SetDimension(elemList.ElementAt(m_nIndex - 1).dDimension - diff); + elemList.ElementAt(m_nIndex ).SetDimension(elemList.ElementAt(m_nIndex).dDimension - diff); + } + else + { + double diff = (m_dDimension - value)/2; + elemList.ElementAt(m_nIndex - 1).SetDimension(elemList.ElementAt(m_nIndex - 1).dDimension + diff); + elemList.ElementAt(m_nIndex).SetDimension(elemList.ElementAt(m_nIndex).dDimension + diff); + } + } if (value > m_dMax) m_dDimension = m_dMax; else if (value < m_dMin) diff --git a/WebWindowComplex/Models/Frame.cs b/WebWindowComplex/Models/Frame.cs index 94c52c6..b96adcd 100644 --- a/WebWindowComplex/Models/Frame.cs +++ b/WebWindowComplex/Models/Frame.cs @@ -197,8 +197,8 @@ namespace WebWindowComplex.Models { DimensionList.Add(new FrameDimension(this, 1, "Width", widthVal, true)); DimensionList.Add(new FrameDimension(this, 2, "Height", 1400, true)); - foreach (var dim in DimensionList) - SearchAreaList(this, dim.dDimension, dim.sName); + SearchAreaList(this, AvailWidthArea(), "Width"); + SearchAreaList(this, AvailHeightArea(), "Height"); break; } @@ -207,8 +207,8 @@ namespace WebWindowComplex.Models DimensionList.Add(new FrameDimension(this, 1, "Width", widthVal, true)); DimensionList.Add(new FrameDimension(this, 2, "Left Height", 1800, true)); DimensionList.Add(new FrameDimension(this, 3, "Right Height", 1500, true)); - SearchAreaList(this, widthVal, "Width"); - SearchAreaList(this, 1800, "Left Height"); + SearchAreaList(this, AvailWidthArea(), "Width"); + SearchAreaList(this, AvailHeightArea(), "Left Height"); break; } @@ -217,8 +217,8 @@ namespace WebWindowComplex.Models DimensionList.Add(new FrameDimension(this, 1, "Width", widthVal, true)); DimensionList.Add(new FrameDimension(this, 2, "Left Height", 1500, true)); DimensionList.Add(new FrameDimension(this, 3, "Right Height", 1800, true)); - SearchAreaList(this, widthVal, "Width"); - SearchAreaList(this, 1800, "Right Height"); + SearchAreaList(this, AvailWidthArea(), "Width"); + SearchAreaList(this, AvailHeightArea(), "Right Height"); break; } @@ -228,8 +228,8 @@ namespace WebWindowComplex.Models DimensionList.Add(new FrameDimension(this, 1, "Width", widthVal, true)); DimensionList.Add(new FrameDimension(this, 2, "Height", 1800 - (0.4 * widthVal), true)); DimensionList.Add(new FrameDimension(this, 3, "Full Height", 1800, true)); - SearchAreaList(this, widthVal, "Width"); - SearchAreaList(this, 1800, "Full Height"); + SearchAreaList(this, AvailWidthArea(), "Width"); + SearchAreaList(this, AvailHeightArea(), "Full Height"); break; } @@ -238,8 +238,8 @@ namespace WebWindowComplex.Models DimensionList.Add(new FrameDimension(this, 1, "Width", widthVal, true)); DimensionList.Add(new FrameDimension(this, 2, "Height", 2400 - (0.6 * widthVal), true)); DimensionList.Add(new FrameDimension(this, 3, "Full Height", 2400, true)); - SearchAreaList(this, widthVal, "Width"); - SearchAreaList(this, 2400, "Full Height"); + SearchAreaList(this, AvailWidthArea(), "Width"); + SearchAreaList(this, AvailHeightArea(), "Full Height"); break; } @@ -249,8 +249,8 @@ namespace WebWindowComplex.Models DimensionList.Add(new FrameDimension(this, 2, "Height", 2400 - (0.4 * widthVal), true)); DimensionList.Add(new FrameDimension(this, 3, "Full Height", 2400, true)); DimensionList.Add(new FrameDimension(this, 4, "Radius", 200, true)); - SearchAreaList(this, 2000, "Width"); - SearchAreaList(this, 2400, "Full Height"); + SearchAreaList(this, AvailWidthArea(), "Width"); + SearchAreaList(this, AvailHeightArea(), "Full Height"); break; } @@ -259,8 +259,8 @@ namespace WebWindowComplex.Models DimensionList.Add(new FrameDimension(this, 1, "Width", widthVal, true)); DimensionList.Add(new FrameDimension(this, 2, "Height", 1500, true)); DimensionList.Add(new FrameDimension(this, 3, "Height projection", 0, true)); - SearchAreaList(this, widthVal, "Width"); - SearchAreaList(this, 1500, "Height"); + SearchAreaList(this, AvailWidthArea(), "Width"); + SearchAreaList(this, AvailHeightArea(), "Height"); break; } @@ -402,7 +402,7 @@ namespace WebWindowComplex.Models m_ThresholdList = m_AllThresholdList; } - public double AvailHeightFrame() + public double AvailHeightArea() { double dim = 0; switch (SelShapeIndex) @@ -432,7 +432,7 @@ namespace WebWindowComplex.Models } double overlap = 0; if (AreaList.First() is Sash) - overlap = ElementDimensionList.ElementAt(1).dOverlap + + overlap = ElementDimensionList.First().dOverlap + ElementDimensionList.ElementAt(ElementDimensionList.Count() - 2).dOverlap; return dim - ElementDimensionList.ElementAt(0).dDimension - ElementDimensionList.Last().dDimension + @@ -457,6 +457,13 @@ namespace WebWindowComplex.Models if(AreaList.First() is Sash) overlap = ElementDimensionList.ElementAt(1).dOverlap + ElementDimensionList.Last().dOverlap; + if (AreaList.First() is Split) + { + Split s = (Split)AreaList.First(); + if(s.SplitHorizList.Count > 0) + overlap = ElementDimensionList.ElementAt(1).dOverlap + + ElementDimensionList.Last().dOverlap; + } return dim - ElementDimensionList.ElementAt(0).dDimension - ElementDimensionList.Last().dDimension + overlap; diff --git a/WebWindowComplex/Models/Sash.cs b/WebWindowComplex/Models/Sash.cs index a57396a..9daa17b 100644 --- a/WebWindowComplex/Models/Sash.cs +++ b/WebWindowComplex/Models/Sash.cs @@ -295,10 +295,10 @@ namespace WebWindowComplex.Models if (bIsDimensionLight) dNewDimension = (dLastDimension - m_SashList.Last().ElementDimensionList.ElementAt(1).dDimension - m_SashList.Last().ElementDimensionList.Last().dDimension - + m_SashList.Last().ElementDimensionList.Last().dOverlap) / 2; + + Window.m_ParameterList.GetValueOrDefault("Sash_Active_Overlap"))/2; else dNewDimension = dLastDimension / (value + 1 - nSashQty) - + (m_SashList.Last().ElementDimensionList.Last().dOverlap / 2); + + (Window.m_ParameterList.GetValueOrDefault("Sash_Active_Overlap"))/2; } m_SashList[m_SashList.Count - 1].SetDimension(dNewDimension); } diff --git a/WebWindowComplex/Models/SashDimension.cs b/WebWindowComplex/Models/SashDimension.cs index 2573aeb..ca93f50 100644 --- a/WebWindowComplex/Models/SashDimension.cs +++ b/WebWindowComplex/Models/SashDimension.cs @@ -225,9 +225,9 @@ namespace WebWindowComplex.Models { // L'anta modificata non è l'ultima if (nIndex < dimensions.Count - 1) - dimensions[nIndex + 1].SetDimension(dimensions[nIndex + 1].m_dDimension + (m_dDimension - value)); + dimensions[nIndex + 1].SetDimension(Math.Round(dimensions[nIndex + 1].m_dDimension + (m_dDimension - value), 2)); else if (dimensions.Count > 1) - dimensions[nIndex - 1].SetDimension(dimensions[nIndex - 1].m_dDimension + (m_dDimension - value)); + dimensions[nIndex - 1].SetDimension(Math.Round(dimensions[nIndex - 1].m_dDimension + (m_dDimension - value), 2)); else { m_dDimension = 100; @@ -289,35 +289,34 @@ namespace WebWindowComplex.Models break; } } + double overlapCurrSash = 0; + if (!Parent.bIsDimensionLight) + { + int j = nIndex == 0 ? 1 : Parent.SashList.ElementAt(nIndex).ElementDimensionList.Count - 1; + overlapCurrSash = Parent.SashList.ElementAt(nIndex).ElementDimensionList.ElementAt(j).dOverlap / 2; + } + int indexDimChange = 0; + // L'anta modificata non è l'ultima + if (nIndex < absoluteValList.Count - 1) + indexDimChange = nIndex + 1; + // L'anta modificata è l'ultima + else if (dimensions.Count > 1) + indexDimChange = nIndex - 1; + double overlap = 0; + if (!Parent.bIsDimensionLight) + { + int j = indexDimChange == 0 ? 1 : Parent.SashList.ElementAt(nIndex + 1).ElementDimensionList.Count - 1; + overlap = Parent.SashList.ElementAt(indexDimChange).ElementDimensionList.ElementAt(j).dOverlap / 2; + } if (value < m_dDimension) { - // L'anta modificata non è l'ultima - if (nIndex < absoluteValList.Count - 1) - { - absoluteValList[nIndex + 1] = absoluteValList[nIndex + 1] + (absoluteValList[nIndex] - valueInAbsolute); - absoluteValList[nIndex] = valueInAbsolute; - } - // L'anta modificata è l'ultima - else if (dimensions.Count > 1) - { - absoluteValList[nIndex - 1] = absoluteValList[nIndex - 1] + (absoluteValList[nIndex] - valueInAbsolute); - absoluteValList[nIndex] = valueInAbsolute; - } + absoluteValList[indexDimChange] = absoluteValList[indexDimChange] + (absoluteValList[nIndex] - (valueInAbsolute - overlapCurrSash)) + overlap; + absoluteValList[nIndex] = valueInAbsolute; } else { - // L'anta modificata non è l'ultima - if (nIndex < absoluteValList.Count - 1) - { - absoluteValList[nIndex + 1] = absoluteValList[nIndex + 1] - (valueInAbsolute - absoluteValList[nIndex]); - absoluteValList[nIndex] = valueInAbsolute; - } - // L'anta modificata è l'ultima - else if (dimensions.Count > 1) - { - absoluteValList[nIndex - 1] = absoluteValList[nIndex - 1] - (valueInAbsolute - absoluteValList[nIndex]); - absoluteValList[nIndex] = valueInAbsolute; - } + absoluteValList[indexDimChange] = absoluteValList[indexDimChange] - ((valueInAbsolute - overlapCurrSash) - absoluteValList[nIndex]) + overlap; + absoluteValList[nIndex] = valueInAbsolute; } if (MeasureType.Equals(MeasureTypes.PROPORTIONAL)) m_dDimension = value; @@ -516,23 +515,30 @@ namespace WebWindowComplex.Models if (SelMeasureType != (MeasureTypes)value) { MeasureTypes newType = (MeasureTypes)value; - Frame frame = m_Parent.ParentWindow.AreaList.FirstOrDefault(); + Frame? frame = m_Parent.ParentWindow.AreaList.FirstOrDefault(); if (frame != null) { - double widthTot = Parent.CalculateWidthSashGroup(frame!, frame!.DimensionList.Where(x => x.sName == "Width").First().dDimension, new AreaFound(-1, false)).m_Dimension; + double widthTot = Parent.CalculateWidthSashGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension; if (Parent.bIsDimensionLight) + { + for(int i = 0; i < Parent.SashList.Count; i++) { - for(int i = 0; i < Parent.SashList.Count; i++) - { - if (i == 0) - widthTot = widthTot - Parent.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension - - Parent.SashList.ElementAt(i).ElementDimensionList.Last().dDimension; - else - widthTot = widthTot - Parent.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension - - Parent.SashList.ElementAt(i).ElementDimensionList.Last().dDimension - + Parent.SashList.ElementAt(i).ElementDimensionList.Last().dOverlap; - } + if (i == 0) + widthTot = widthTot - Parent.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension + - Parent.SashList.ElementAt(i).ElementDimensionList.Last().dDimension; + else + widthTot = widthTot - Parent.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension + - Parent.SashList.ElementAt(i).ElementDimensionList.Last().dDimension + + Parent.SashList.ElementAt(i).ElementDimensionList.Last().dOverlap; } + } + else + { + for (int i = 0; i < m_Parent.SashList.Count - 1; i++) + { + widthTot = widthTot + m_Parent.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dOverlap; + } + } AreaDimension ad = new AreaDimension(dDimension, SelMeasureType, Parent); //if(SelMeasureType is MeasureTypes.ABSOLUTE) // ad = new AreaDimension(dDimension - ElementDimensionList.ElementAt(1).dOverlap, SelMeasureType); diff --git a/WebWindowComplex/Models/SplitDimension.cs b/WebWindowComplex/Models/SplitDimension.cs index f5a9a01..4b0c2b8 100644 --- a/WebWindowComplex/Models/SplitDimension.cs +++ b/WebWindowComplex/Models/SplitDimension.cs @@ -61,7 +61,7 @@ namespace WebWindowComplex.Models { dimensions = m_Parent.SplitHorizList; //dimensionTot = (CalculateHeightSplitGroup(m_Parent, HeightTot(), new AreaFound(-1, false))).m_Dimension; - dimensionTot = (CalculateHeightSplitGroup(frame, frame.AvailHeightFrame(), new AreaFound(-1, false))).m_Dimension; + dimensionTot = (CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false))).m_Dimension; } double valMinAbsolute = 100; double valMaxAbsolute = dimensionTot - valMinAbsolute * (dimensions.Count - 1); @@ -270,7 +270,7 @@ namespace WebWindowComplex.Models else { splitList = m_Parent.SplitHorizList; - tot = (CalculateHeightSplitGroup(frame, frame.AvailHeightFrame(), new AreaFound(-1, false))).m_Dimension; + tot = (CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false))).m_Dimension; foreach (var item in m_Parent.ElemDimHorizList) { tot = tot - item.dDimension; @@ -386,11 +386,31 @@ namespace WebWindowComplex.Models { adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent)); } - int index = adList.IndexOf(ad) == 0 ? 1 : adList.Count - 1; - double dim = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, width) + sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(index).dOverlap / 2; - dim = dim - - sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension - - sash.SashList.ElementAt(i).ElementDimensionList.Last().dDimension; + double widthTot = width; + int index = adList.IndexOf(ad) == 0 ? 1 : adList.Count - 1; ; + double dim = 0; + if (sash.bIsDimensionLight) + { + for (int anta = 0; anta < sash.SashList.Count; anta++) + { + if (anta == 0) + widthTot = widthTot - sash.SashList.ElementAt(anta).ElementDimensionList.ElementAt(1).dDimension + - sash.SashList.ElementAt(anta).ElementDimensionList.Last().dDimension; + else + widthTot = widthTot - sash.SashList.ElementAt(anta).ElementDimensionList.ElementAt(1).dDimension + - sash.SashList.ElementAt(anta).ElementDimensionList.Last().dDimension + + sash.SashList.ElementAt(anta).ElementDimensionList.Last().dOverlap; + } + dim = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, widthTot); + } + else + { + dim = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, widthTot) + + sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(index).dOverlap / 2; + dim = dim - + sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension - + sash.SashList.ElementAt(i).ElementDimensionList.Last().dDimension; + } res = CalculateWidthSplitGroup(item, dim, res); break; } @@ -443,6 +463,7 @@ namespace WebWindowComplex.Models Split split = (Split)area; if (split.SplitHorizList.Count > 0) { + double dim = height; int index = i; if (split.SelSplitShape is SplitShapes.GRID) index = i % split.SplitHorizList.Count; @@ -450,29 +471,58 @@ namespace WebWindowComplex.Models { case MeasureTypes.ABSOLUTE: { - double heightItemGroup = split.SplitHorizList.ElementAt(index).dDimension; - res = CalculateHeightSplitGroup(item, heightItemGroup, res); + dim = split.SplitHorizList.ElementAt(index).dDimension; + //res = CalculateHeightSplitGroup(item, heightItemGroup, res); break; } case MeasureTypes.PROPORTIONAL: { + double heigthGlass = 0; AreaDimension ad = new AreaDimension(split.SplitHorizList.ElementAt(index).dDimension, split.SplitHorizList.ElementAt(index).SelMeasureType, split.SplitHorizList.ElementAt(index).Parent); List adList = new List(); foreach (var it in split.SplitHorizList) { adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent)); } - double heightItemGroup = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, height); - res = CalculateHeightSplitGroup(item, heightItemGroup, res); + foreach (var elem in split.ElemDimHorizList) + { + heigthGlass = heigthGlass - elem.dDimension; + } + dim = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, heigthGlass); + //res = CalculateHeightSplitGroup(item, heightItemGroup, res); break; } case MeasureTypes.PERCENTAGE: { - double heightItemGroup = split.SplitHorizList.ElementAt(index).dDimension * height / 100; - res = CalculateHeightSplitGroup(item, heightItemGroup, res); + foreach(var elem in split.ElemDimHorizList) + dim = dim - elem.dDimension; + dim = split.SplitHorizList.ElementAt(index).dDimension * dim / 100; + //res = CalculateHeightSplitGroup(item, heightItemGroup, res); break; } } + if (split.ParentArea is Frame && split.AreaList.ElementAt(i).AreaList.First() is Sash) + { + Frame frame = (Frame)split.ParentArea; + string pos = i == 0 ? "_Top_Overlap" : "_Bottom_Overlap"; + string overlapName = string.Join("_", split.ElemDimHorizList.First().sName.Split('_').Skip(1)); + if (i == 0) + { + dim = dim + frame.ElementDimensionList.First().dOverlap + + Window.m_ParameterList.GetValueOrDefault(overlapName + "_Bottom_Overlap"); + } + else if (i == split.SplitHorizList.Count - 1) + { + dim = dim + frame.ElementDimensionList.ElementAt(frame.ElementDimensionList.Count - 2).dOverlap + + Window.m_ParameterList.GetValueOrDefault(overlapName + "_Top_Overlap"); + } + else + { + dim = dim + Window.m_ParameterList.GetValueOrDefault(overlapName + "_Top_Overlap") + + Window.m_ParameterList.GetValueOrDefault(overlapName + "_Bottom_Overlap"); + } + } + res = CalculateHeightSplitGroup(item, dim, res); if (res.m_Dimension != -1 && res.m_Found) return res; } @@ -534,7 +584,6 @@ namespace WebWindowComplex.Models double dimSplitGroup = 0; if (bIsVertListDim) { - //dimSplitGroup = (CalculateWidthSplitGroup(frame, frame.DimensionList.Where(x => x.sName == "Width").First().dDimension, new AreaFound(-1, false))).m_Dimension; dimSplitGroup = (CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false))).m_Dimension; foreach (var item in m_Parent.ElemDimVertList) { @@ -558,8 +607,17 @@ namespace WebWindowComplex.Models else { //tot = (CalculateHeightSplitGroup(m_Parent, HeightTot(), new AreaFound(-1, false))).m_Dimension; - dimSplitGroup = (CalculateHeightSplitGroup(frame, frame.AvailHeightFrame(), new AreaFound(-1, false))).m_Dimension; - foreach (var item in m_Parent.ElemDimHorizList) + dimSplitGroup = (CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false))).m_Dimension; + List elemList = new List(); + if (Parent.bSplitStartVert || Parent.nSplitQtyVert == 0) + { + for (int i = 0; i < m_Parent.ElemDimHorizList.Count; i++) + { + if( i == i + m_Parent.ElemDimVertList.Count * i) + elemList.Add(m_Parent.ElemDimHorizList.ElementAtOrDefault(i)); + } + } + foreach (var item in elemList) { dimSplitGroup = dimSplitGroup - item.dDimension; } diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 7e08e13..ee45d3a 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -638,8 +638,9 @@ namespace WebWindowComplex { firstDisplay = false; // preview SVG senza HW - await UpdateElement(FrameWindow); await DoPreviewSvg(true, true); + if(LiveData.ProfElementList.Count == 0) + await UpdateElement(FrameWindow); } List reqList = SashList.Select(x => x.GroupId).ToList(); if (reqList.Count > 0) diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index b302bba..0a02c32 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.1218 + 3.1.2.1617 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -101,6 +101,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index dc73505..bd76ea0 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.1218 + 3.1.2.1617 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -89,6 +89,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +