[ 
https://issues.apache.org/jira/browse/PIVOT-783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13075998#comment-13075998
 ] 

Chris Bartlett commented on PIVOT-783:
--------------------------------------

Yes, I think in retrospect 'bug' isn't especially accurate.  'Wish' or 
'improvement' would be better.  'Defect' doesn't sit right with me just because 
it currently behaves *as intended*, even if that is not *as expected* or *as 
wanted*, but that is just my opinion.  JIRA categorizations aren't particularly 
controversial, so set it as you feel, but knowing that it might be adjusted 
later.

The reasoning behind the current logic means that a single decorator instance 
can be applied to multiple Components.  Decorators are designed purely to 
'decorate' Components *when* the paint() call occurs.  This might make more 
sense when considering other decorators (such as FadeDecorator or 
ShadeDecorator) rather than ScaleDecorator.  (The Component maintains a list of 
attached Decorators, but the Decorators have no knowledge of which Component, 
if any, they are applied to)

I don't see any obvious complexities that you overlooked, but also don't know 
if Pivot needs to be *fixed*. 
(If the decorator invalidates a parent container with a decorator, could it 
lead to an infinite loop?)

It is late here now, so I'll think about it and get back to you later when I 
have a clearer mind.

> Calling setScale on scaleDecorator doesn't update the display
> -------------------------------------------------------------
>
>                 Key: PIVOT-783
>                 URL: https://issues.apache.org/jira/browse/PIVOT-783
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk
>    Affects Versions: 2.0
>            Reporter: Bill van Melle
>            Priority: Minor
>             Fix For: 2.0.1
>
>
> When you call setScale on a scaleDecorator that's already in the display 
> tree, the display does not update. You can't see the effect of the change 
> until something else causes a repaint. 
> Looking at the code, isn't this an issue for decorators in general? I don't 
> see any mechanism for decorators to notify the component (or components?) 
> that they are attached to that they've changed. If you're not going to 
> notify, then shouldn't decorators be immutable objects? (Of course, that 
> would break a lot of code.) 
> FWIW, a demonstration: 
> <Window title="Scale change" maximized="true"
>   xmlns:bxml="http://pivot.apache.org/bxml";
>   xmlns:effects="org.apache.pivot.wtk.effects"
>   xmlns="org.apache.pivot.wtk">
>   <BoxPane orientation="vertical" preferredWidth="300">
>     <PushButton buttonData="Change">
>       <buttonPressListeners>
>         function buttonPressed(button) {
>           scaleDecorator.setScale(2.0);
>         }
>       </buttonPressListeners>
>     </PushButton>
>     <Label text="This text should get twice as big when I push the button">
>       <decorators>
>         <effects:ScaleDecorator bxml:id="scaleDecorator" 
>           horizontalAlignment="left" verticalAlignment="top" />
>       </decorators>
>     </Label>
>   </BoxPane>
> </Window>

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to