From af04d45c214b374be878af6add27e4b1fa3a0e7a Mon Sep 17 00:00:00 2001 From: Ian Harrigan Date: Wed, 22 May 2024 19:20:00 +0200 Subject: [PATCH] dont override handleClipRect behaviour if virtual --- haxe/ui/backend/ComponentImpl.hx | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/haxe/ui/backend/ComponentImpl.hx b/haxe/ui/backend/ComponentImpl.hx index f45aaa3..5cf57ec 100644 --- a/haxe/ui/backend/ComponentImpl.hx +++ b/haxe/ui/backend/ComponentImpl.hx @@ -126,6 +126,12 @@ class ComponentImpl extends ComponentBase { } private override function get_isHybridScroller():Bool { + if ((this is IScroller)) { + var scroller = cast(this, IScroller); + if (scroller.virtual) { + return false; + } + } return Platform.instance.useHybridScrollers; } @@ -318,11 +324,18 @@ class ComponentImpl extends ComponentBase { value.toInts(); if (Platform.instance.useHybridScrollers) { - if (value != null && parent != null) { - parent.element.scrollTop = Std.int(value.top); - parent.element.scrollLeft = Std.int(value.left); + var use = true; + if ((parent is IScroller)) { + var scroller = cast(parent, IScroller); + use = !scroller.virtual; + } + if (use) { + if (value != null && parent != null) { + parent.element.scrollTop = Std.int(value.top); + parent.element.scrollLeft = Std.int(value.left); + } + return; } - return; } if (value != null && parent != null) {