[ 
https://issues.apache.org/jira/browse/PIVOT-226?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Todd Volkert updated PIVOT-226:
-------------------------------

    Affects Version/s:     (was: 1.3)
        Fix Version/s:     (was: 1.3)

Removing 1.3 tags so it doesn't show up in release notes.

> Cached preferred size values cause layout problems in BoxPane
> -------------------------------------------------------------
>
>                 Key: PIVOT-226
>                 URL: https://issues.apache.org/jira/browse/PIVOT-226
>             Project: Pivot
>          Issue Type: Bug
>            Reporter: Greg Brown
>            Assignee: Greg Brown
>            Priority: Minor
>
> We currently cache the values of the preferred size calculations for 
> performance reasons. As a result, when a vertical BoxPane is set to fill the 
> available space, the widest component doesn't get scaled up (nor do any other 
> components that report the same preferred width).
> One possible fix is to call invalidate() on the component in BoxPane#layout() 
> before asking it for its constrained preferred height. That ensures that we 
> get the correct value, and it doesn't impose a significant performance 
> penalty most of the time. 
> However, this may not be the "right" place to put this logic. Since this is a 
> side effect of caching logic in Component, the logic for invalidating the 
> cache probably also belongs in Component. Ideally, containers such as BoxPane 
> shouldn't need to know that they must call invalidate() in order to clear the 
> cache.
> A better solution may be to add a method to Skin that will allow Component to 
> ask it how to handle cases like this. The exact nature/name of this method is 
> TBD. Some ideas:
> isFixedAspectRatio():boolean
> isVariableAspectRatio():boolean
> getPreferredAspectRatio():float (if Float.NaN, aspect ratio is not fixed)
> If any of these return true/non-NaN, Component would know that it shouldn't 
> use the cached value.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to