Reputation: 11
I am creating a diagram using JointJS library. I want to create a shape and add it to the top corner of the paper upon request of the user.
The problem is that the shape does not show up at the position that I expect.
The element of paper is a div with id of #paper.
When creating the shape, I gave it the following position: x: $('#paper').offset().left y: $('#paper').offset().top
Any idea why I cannot see the created shape?
Thanks
Upvotes: 0
Views: 349
Reputation: 305
Have you tried looking at the execution in a debugger to make sure you're getting the x and y you expect from your offset calls? What sort of SVG shape are you defining; do you know where the origin point is for that shape? Again, you should be able to see what was set in a debugger such as Chrome's dev tools.
It might be helpful to see the applicable actual code involved, as well.
Upvotes: 1