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

Graphviz.scale() overwrites height and width values when it's used in a method chain #13

Closed
sparsick opened this issue Apr 7, 2017 · 1 comment

Comments

@sparsick
Copy link
Contributor

sparsick commented Apr 7, 2017

I use the static methods (scale(), heigth(), width()) in a method chaining for configuring Graphviz. Unfortunately, the scale() method overwrites the height and width values to 0.

Following failing unit test demonstrates the behaviour

 @Test
    public void methodChainCheck(){
        final Graph graph = graph().with(node("a").link("b"));

        final Graphviz graphviz = Graphviz.fromGraph(graph).height(20).width(30).scale(3);

        assertThat(graphviz.width, is(30) );
        assertThat(graphviz.height, is(20) );
        assertThat(graphviz.scale, is(3d ));
    }

Test result is:

java.lang.AssertionError: 
Expected: is <30>
     but: was <0>
Expected :is <30>
     
Actual   :<0>

My expectation would be that this test runs successfully.

This same behaviour is watchable if width()or height() is the last method call in a method chain.

@nidi3
Copy link
Owner

nidi3 commented Apr 11, 2017

merged.

@nidi3 nidi3 closed this as completed Apr 11, 2017
syoon2 referenced this issue in Summer2023SHY/graphviz-java May 18, 2023
…ough/decode-uri-component-0.2.2

Bump decode-uri-component from 0.2.0 to 0.2.2 in /graphviz-rough
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants