Fix initial panels being created too large#21
Fix initial panels being created too large#21Henri-J-Norden wants to merge 3 commits intoyasirkula:masterfrom
Conversation
|
On a project that I'm working on, I've encountered an issue where initial sizes of anchored panels wouldn't be respected in some cases. I've resolved it by changing the following lines: UnityDynamicPanels/Plugins/DynamicPanels/Scripts/DynamicPanelsCanvas.cs Lines 453 to 454 in 0d0a19d As follows: if( initialSizes.TryGetValue( panel, out initialSize ) )
{
if( initialSize.x <= Mathf.Epsilon )
initialSize.x = panel.Size.x;
if( initialSize.y <= Mathf.Epsilon )
initialSize.y = panel.Size.y;
panel.ResizeTo( initialSize, Direction.Right, Direction.Top );
}I'm wondering if this fix applies to your scenario, as well. Did you encounter this issue on free panels? If not, could you provide simple repro steps for me to follow? |
|
Yes, I had the issue with free panels. But I also encountered a related problem when using |
Issue: Panel.m_minSize is initialized to (200, 200), but when an initial panel with smaller tabContent is added, the panel is created larger than the tabContent, because in PanelUtils.CreatePanel:
result.FloatingSize = contentRect.size;, which already clamped the panel size to the initial (200, 200) valueFix: avoid initializing Panel.m_minSize to a value > 0 to support creating panels smaller than (200, 200)