Open dropdowns within the visible part of their list
ElementContext carries the part of the screen where an element can be seen, passed down in a Frame and narrowed by each Scroll to its own box. A dropdown opens below only if its list fits in that part, otherwise above if it fits there, or else on the side with more room, so one at the bottom of a scrolled list no longer opens past the list's edge. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -42,8 +42,7 @@ public class AnimationStagger extends Element {
|
||||
ElementRenderer.render(children, ctx.elapsed, renderScope,
|
||||
ctx.mouseX,
|
||||
ctx.mouseY,
|
||||
ctx.originX,
|
||||
ctx.originY);
|
||||
ctx.childFrame());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -81,8 +81,7 @@ public class Scroll extends Element {
|
||||
ElementRenderer.render(children, ctx.elapsed, renderScope,
|
||||
ctx.mouseX - padding,
|
||||
ctx.mouseY - padding + offset,
|
||||
ctx.originX + padding,
|
||||
ctx.originY + padding - offset);
|
||||
ctx.childFrame(padding, padding - offset, padding, height - padding));
|
||||
|
||||
renderScope.getMatrixStack().pop();
|
||||
renderScope.disableScissor();
|
||||
|
||||
Reference in New Issue
Block a user