haxeui-core
haxeui-core copied to clipboard
`VirtualLayout` caches `itemWidth` and `itemHeight` which cause problems when `Toolkit.pixelsPerRem` value is changed
VirtualLayout
caches itemWidth
and itemHeight
which cause problems when Toolkit.pixelsPerRem
value is changed. As a solution I use the following patch in ListView
class ListViewEvents extends ScrollViewEvents {
...
public override function register() {
...
registerEvent(UIEvent.RESIZE, onUIResize);
...
}
public override function unregister() {
...
unregisterEvent(UIEvent.RESIZE, onUIResize);
...
}
private function onUIResize(e:UIEvent) {
_listview.itemHeight = 0;
_listview.itemWidth = 0;
}
...
I'm not sure this solution follows the concepts of a framework, so it has to be re-thought. Also reworked solution should cover TableView
as well.