performance - What is better for perfomance width="100%" or left="0" right="0"? -
in latest adobe flex sdk 4.6, better performance view?
<s:group width="100%" height="100%"/> or
<s:group left="0" right="0" top="0" bottom="0"/> thank you.
in basiclayout.updatedisplaylist() found (in loop every child element):
if (!isnan(percentwidth)) { var availablewidth:number = unscaledwidth; if (!isnan(left)) availablewidth -= left; if (!isnan(right)) availablewidth -= right; childwidth = math.round(availablewidth * math.min(percentwidth * 0.01, 1)); elementmaxwidth = math.min(layoutelement.getmaxboundswidth(), maxsizetofitin(unscaledwidth, hcenter, left, right, layoutelement.getlayoutboundsx())); } else if (!isnan(left) && !isnan(right)) { childwidth = unscaledwidth - right - left; } and same height.
so, looks like:
- percenwidth has higher priority top , left (if both set)
- top , left calculated easier percenwidth (single subtraction against round, functions call , conditions)
- top , left may used styles declarations.
also, of flex4 skins based top , left - think performance reason too.
Comments
Post a Comment