mirror of https://github.com/buggins/dlangui.git
Ignore percent layout size if there is only one widget.
This commit is contained in:
parent
9d8e314eac
commit
5bd0ea1d10
|
|
@ -110,7 +110,6 @@ class LayoutItems {
|
||||||
_maxSecondarySize = 0;
|
_maxSecondarySize = 0;
|
||||||
_measureParentSize.x = parentWidth;
|
_measureParentSize.x = parentWidth;
|
||||||
_measureParentSize.y = parentHeight;
|
_measureParentSize.y = parentHeight;
|
||||||
// bool
|
|
||||||
bool hasPercentSizeWidget = false;
|
bool hasPercentSizeWidget = false;
|
||||||
size_t percenSizeWidgetIndex;
|
size_t percenSizeWidgetIndex;
|
||||||
// measure
|
// measure
|
||||||
|
|
@ -133,8 +132,8 @@ class LayoutItems {
|
||||||
}
|
}
|
||||||
if (hasPercentSizeWidget) {
|
if (hasPercentSizeWidget) {
|
||||||
LayoutItem * item = &_list[percenSizeWidgetIndex];
|
LayoutItem * item = &_list[percenSizeWidgetIndex];
|
||||||
|
if (_totalSize > 0)
|
||||||
item._measuredSize = to!int(_totalSize * ((1 / (1 - cast (double) (fromPercentSize(item._layoutSize, 100))/100)) - 1));
|
item._measuredSize = to!int(_totalSize * ((1 / (1 - cast (double) (fromPercentSize(item._layoutSize, 100))/100)) - 1));
|
||||||
_totalSize += item._measuredSize;
|
_totalSize += item._measuredSize;
|
||||||
}
|
}
|
||||||
return _orientation == Orientation.Horizontal ? Point(_totalSize, _maxSecondarySize) : Point(_maxSecondarySize, _totalSize);
|
return _orientation == Orientation.Horizontal ? Point(_totalSize, _maxSecondarySize) : Point(_maxSecondarySize, _totalSize);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue