Skip to content

Commit d0bd526

Browse files
committed
fix getting page size
1 parent 13de7fa commit d0bd526

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

haxe/ui/containers/ScrollView.hx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,14 @@ private class HScrollPageSize extends DataBehaviour {
478478
_scrollview = scrollview;
479479
}
480480

481+
public override function get():Variant {
482+
var hscroll = _scrollview.findComponent(HorizontalScroll, false);
483+
if (hscroll == null) {
484+
return 0;
485+
}
486+
return hscroll.pageSize;
487+
}
488+
481489
public override function validateData() { // TODO: feels a bit ugly!
482490
if (_scrollview.virtual == true) {
483491
var hscroll = _scrollview.findComponent(HorizontalScroll, false);
@@ -524,6 +532,14 @@ private class VScrollPageSize extends DataBehaviour {
524532
_scrollview = scrollview;
525533
}
526534

535+
public override function get():Variant {
536+
var vscroll = _scrollview.findComponent(VerticalScroll, false);
537+
if (vscroll == null) {
538+
return 0;
539+
}
540+
return vscroll.pageSize;
541+
}
542+
527543
public override function validateData() { // TODO: feels a bit ugly!
528544
if (_scrollview.virtual == true) {
529545
var vscroll = _scrollview.findComponent(VerticalScroll, false);

0 commit comments

Comments
 (0)