Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

estimatedScrollYProperty bindBidirectonal not working as assumed #535

Closed
bjfiedler opened this issue Jun 23, 2017 · 2 comments
Closed

estimatedScrollYProperty bindBidirectonal not working as assumed #535

bjfiedler opened this issue Jun 23, 2017 · 2 comments

Comments

@bjfiedler
Copy link

bjfiedler commented Jun 23, 2017

Hi,

I would like to have two CodeArea's next to each other with the same content height to be always scrolled to the same position. Scrolling on the left makes the right follow as assumed. Scrolling on the right produces several unexpected results:

  • left does not always scroll to the endposition (top/bottom most)
  • after a short downmovement an up movement on the scrollwheel results in more down movement of the content

My code

    public class Test2  extends Application{

        String ts = "42\n\n54\n5435\n4325\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n5435\n\n423\n53\n2\n5423\n5342\n54\n5435\n4325\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n5435\n\n423\n53\n2\n5423\n53";
        @Override
        public void start(Stage primaryStage) throws Exception {
            HBox sp = new HBox();
            CodeArea lca = new CodeArea();
            VirtualizedScrollPane<CodeArea> lsp = new VirtualizedScrollPane<>(lca);

            CodeArea rca = new CodeArea();
            VirtualizedScrollPane<CodeArea> rsp = new VirtualizedScrollPane<>(rca);

            sp.getChildren().addAll(lsp, rsp);
            lca.estimatedScrollYProperty().bindBidirectional(rca.estimatedScrollYProperty());

            lca.replaceText(ts);
            rca.replaceText(ts);

            Scene sc = new Scene(sp);
            primaryStage.setScene(sc);
            primaryStage.show();

        }

        public static void main(String[] args){
            launch(args);
        }
    }

This standard JavaFX Code illustrates the intended behaviour:

    public class Test3  extends Application{

        String ts = "42\n\n54\n5435\n4325\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n5435\n\n423\n53\n2\n5423\n5342\n54\n5435\n4325\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n5435\n\n423\n53\n2\n5423\n53";
        @Override
        public void start(Stage primaryStage) throws Exception {
            HBox sp = new HBox();
            TextArea lca = new TextArea();

            TextArea rca = new TextArea();

            sp.getChildren().addAll(lca, rca);
            rca.scrollTopProperty().bindBidirectional(lca.scrollTopProperty());

            lca.setText(ts);
            rca.setText(ts);

            Scene sc = new Scene(sp);
            primaryStage.setScene(sc);
            primaryStage.show();

        }

        public static void main(String[] args){
            launch(args);
        }
    }
@JordanMartinez
Copy link
Contributor

Which version are you using?

This seems to be a bug in Flowless.

@bjfiedler
Copy link
Author

Hi, my mail reply semms to be lost. I'm using the M5 fat jar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants