Hi Alex, don't know of code that would break, but I think that would be the right thing to do. So better fix to comply with that change.
What I'm more concern is about getting the pixel width or height when sizeChanged or layoutNeeded are thrown from layouts. As I stated before in other thread I had some issues, and yesterday Piotr reported another issue in DataGrid when width="100%" (or any other percentage). I could "hack" height using low level js requestAnimationFrame, but don't know how to fix percentage width problems. I don't find any way to make calculations in Royale to get the real pixel width value when a component has width set to some percentage value. The only way I'm seeing right now is to make some js low level hack with calc(% -px) in style.width. I think now that we have some infrastructure and examples with Cards, HGroups/VGroups, and more, is a good time to have some easy way to get to the layout() method (or other handler) and get directly width or height instead of 0 in the case we are using some % value. Now that I have to work on the fix for Piotr, what do you think about to take you a look and see that real case problem? Piotr committed yesterday that DataGrid example to TDJ. If you want we can work over it together and try what you think it could be a good option. Would be that possible? Thanks Carlos El sáb., 14 mar. 2020 a las 6:12, Alex Harui (<[email protected]>) escribió: > Hi, > > I am wanting to change the way UIBase setWidthAndHeight dispatches its > events to cut down on the number of layout passes. > > Right now, if you change both the width and height of a component, you get > 3 events (widthChanged, heightChanged, sizeChanged). I want to change that > so that you only get sizeChanged. This change would cause the "meaning" of > widthChanged to mean that only the width changed during a resize so you can > optimize some of the layout code and similar for heightChanged. And thus, > you will only ever get one event out of setWidthAndHeight, it will either > be: > > - "widthChanged" meaning that only the width has changed > - "heightChanged" meaning that only the height has changed > - "sizeChanged" meaning that both width and height have changed > > Does anyone know of any code that would break if we made this change? > Everywhere I look, code listens to all 3 and does not react differently so > sometimes lays out 3 times, often once before the height has changed. > > Thoughts? > -Alex > > -- Carlos Rovira http://about.me/carlosrovira
