Im hitting a scrollRect
issue when targeting DOM. Below is a minimal test case with outputs for both DOM and webgl (other targets work fine - like webgl):
var outer = new Sprite();
outer.x = 150;
outer.y = 50;
outer.graphics.beginFill(0xFFCCCC);
outer.graphics.drawRect(0, 0, 200, 200);
outer.graphics.endFill();
Lib.current.stage.addChild(outer);
var inner = new Sprite();
inner.x = 10;
inner.y = 10;
inner.graphics.beginFill(0xCCFFCC);
inner.graphics.drawRect(0, 0, 500, 180);
inner.graphics.endFill();
outer.addChild(inner);
var item1 = new Sprite();
item1.x = 10;
item1.y = 10;
item1.graphics.beginFill(0xCCCCFF);
item1.graphics.drawRect(0, 0, 160, 160);
item1.graphics.endFill();
inner.addChild(item1);
var item2 = new Sprite();
item2.x = 170;
item2.y = 10;
item2.graphics.beginFill(0xFFCCFF);
item2.graphics.drawRect(0, 0, 160, 160);
item2.graphics.endFill();
inner.addChild(item2);
var item3 = new Sprite();
item3.x = 330;
item3.y = 10;
item3.graphics.beginFill(0xFFFFCC);
item3.graphics.drawRect(0, 0, 160, 160);
item3.graphics.endFill();
inner.addChild(item3);
outer.scrollRect = new Rectangle(0, 0, 200, 200);
inner.x = -50;
Webgl (correct / expected):
DOM (incorrect / unexpected):
Its not the exact issue im facing, but its extremely similar, and when i removed haxeui from the equation this happened, so im pretty sure that it’ll end up being the same thing.
Any thoughts? Looking at the output dom it seems that it hasnt clipped the inner sprite. The actual issue i get (in haxeui) is that it also has strange clipping for the inner boxes too (the “items”), it clips them all at their exact size, so you end up seeing them too - but i havent yet managed to reproduce that in plain openfl.
Cheers,
Ian