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

Incorrect scaling when trying to draw node in hidden div. #262

Closed
MartinRogalla opened this issue Feb 25, 2016 · 4 comments
Closed

Incorrect scaling when trying to draw node in hidden div. #262

MartinRogalla opened this issue Feb 25, 2016 · 4 comments
Labels

Comments

@MartinRogalla
Copy link


Steps to reproduce problem:

  1. Create a Paper which has the visibility attribute set to hidden.
  2. Add an joint.shapes.fsa.State with width and height set to 80.
  3. Set visibility to true.

What I expect:
A state that has a decent size for displaying on screen.

What I observe:
A state that has an okay label, but has a radius which goes far outside of the Paper region.


Also found someone having the same problem on Stack Overflow:
JointJS diagram drawn in hidden div has wrong scale - Stack Overflow

@chill117
Copy link
Contributor

I've experienced a similar issue before. The problem is that the methods for getting the bounding box of an HTML/SVG element only work when the element is in the DOM and is visible. Instead of using visibility: hidden try position: absolute; left: -99999em on the div container element.

@chill117 chill117 added the bug label Feb 26, 2016
@kfeine-FR
Copy link

Hi,
Same problem here, is there another way to fix this now ?
I need to manage graphs in many tabs and only the visible tab displays graphs properly.

@kumilingus
Copy link
Contributor

Note there is an API proposal ( #407 ) that should help to solve the issue. Please bear with us.

@kumilingus
Copy link
Contributor

See #407

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

No branches or pull requests

4 participants