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

heigth ignored in canvas #10

Open
pedritomelenas opened this issue Aug 19, 2020 · 1 comment
Open

heigth ignored in canvas #10

pedritomelenas opened this issue Aug 19, 2020 · 1 comment

Comments

@pedritomelenas
Copy link
Contributor

If one changes the height parameter in the example 4.3-1 in the manual, and draws a larger cross, it gets truncated.

CreateVisualization(
rec( tool := "canvas", height := 500 ),
    """
    // visualization is the canvas element
    var context = visualization.getContext( '2d' );
    // draw an X
    context.beginPath();
    context.moveTo( 0, 0 );
    context.lineTo( 500, 500 );
    context.moveTo( 500, 0 );
    context.lineTo( 0, 500 );
    context.stroke();
    """
);

image

Probably, I am doing something wrong...

@pedritomelenas
Copy link
Contributor Author

Indeed, there is not need to change the height in the example, if one makes the cross larger, it will also be truncated.

CreateVisualization(
    rec( tool := "canvas", height := 300 ),
    """
    // visualization is the canvas element
    var context = visualization.getContext( '2d' );
    // draw an X
    context.beginPath();
    context.moveTo( 0, 0 );
    context.lineTo( 200, 200 );
    context.moveTo( 200, 0 );
    context.lineTo( 0, 200 );
    context.stroke();
    """
);

image

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

1 participant