On Tue, 9 Dec 2025 00:28:00 GMT, Michael Strauß <[email protected]> wrote:

>> Is there something that prevents us to invent a new anchor type?
>
> Maybe we can specify two anchors:
> 
> void Stage.relocate(AnchorPoint screenAnchor, AnchorPoint stageAnchor);
> 
> 
> Then, if you want to center the window on the screen, you can do:
> 
> myStage.relocate(AnchorPoint.proportional(0.5, 0.5), 
> AnchorPoint.proportional(0.5, 0.5));
> // or myStage.relocate(AnchorPoint.CENTER, AnchorPoint.CENTER);

I like it, because we can easily cover almost all the possible cases.  

Should we also allow to specify the `Screen`?  In a third parameter to this 
extended method?  And if the `Screen` is `null`, the logic would use the 
default screen or the owner's one?  What do you think?

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1986#discussion_r2603354322

Reply via email to