private void CalculateDrawingParts(float newWidth)
        {
            width = newWidth;
            stylesById.Clear();
            namesById.Clear();
            rectsById.Clear();
            heightsById.Clear();
            foreach (var idGroupPair in componentGroupsById)
            {
                ComponentGroupGUI.CalculateDrawingParts(new List <ComponentType>(idGroupPair.Value.Types.Skip(1)), false, width, out var height, out var styles, out var names, out var rects);
                stylesById.Add(idGroupPair.Key, styles);
                namesById.Add(idGroupPair.Key, names);
                rectsById.Add(idGroupPair.Key, rects);
                heightsById.Add(idGroupPair.Key, height);
            }
            foreach (var idQueryPair in queriesById)
            {
                var types = new List <ComponentType>();
                types.AddRange(idQueryPair.Value.All);
                types.AddRange(idQueryPair.Value.Any);
                types.AddRange(idQueryPair.Value.None.Select(x => ComponentType.Subtractive(x.GetManagedType())));

                ComponentGroupGUI.CalculateDrawingParts(types, true, width, out var height, out var styles, out var names, out var rects);
                stylesById.Add(idQueryPair.Key, styles);
                namesById.Add(idQueryPair.Key, names);
                rectsById.Add(idQueryPair.Key, rects);
                heightsById.Add(idQueryPair.Key, height);
            }
            RefreshCustomRowHeights();
        }
示例#2
0
 private void CalculateDrawingParts(float newWidth)
 {
     width = newWidth;
     componentGroupStylesById.Clear();
     componentGroupNamesById.Clear();
     componentGroupRectsById.Clear();
     componentGroupHeightsById.Clear();
     foreach (var idGroupPair in componentGroupsById)
     {
         ComponentGroupGUI.CalculateDrawingParts(idGroupPair.Value.Types, width, out var height, out var styles, out var names, out var rects);
         componentGroupStylesById.Add(idGroupPair.Key, styles);
         componentGroupNamesById.Add(idGroupPair.Key, names);
         componentGroupRectsById.Add(idGroupPair.Key, rects);
         componentGroupHeightsById.Add(idGroupPair.Key, height);
     }
     RefreshCustomRowHeights();
 }