iVis-at-Bilkent / cytoscape.js-grid-guide

A Cytsocape.js extension to provide a framework for grid interactions such as grid lines and snapping to grid, and guidelines and snap support for alignment of nodes.
MIT License
59 stars 9 forks source link

Empty style of grid canvas when drawGrid is false #35

Closed egoag closed 6 years ago

egoag commented 6 years ago

I noticed that if I set {drawGrid: false}, there will be an empty canvas element which cause the whole canvas height higher than it should be. I'm using cytoscape@3.2.17 with cytoscape-grid-guide@2.2.0.

egoag commented 6 years ago

To someone encounter this problem, I fixed it by adding this style:

#graph > canvas {
    position: absolute; 
    top: 0px; 
    left: 0px;
}
egoag commented 6 years ago

Hi @ugurdogrusoz , why closed? I think the grid canvas should be set the above style maybe also width and height properties instead of nothing when drawGrid is false.

ugurdogrusoz commented 6 years ago

I thought you said you resolved the problem! Please provide a minimal JS Fiddle which reproduces your problem.

egoag commented 6 years ago

My bad, thanks for reopening!
https://jsfiddle.net/youyaochi/w8qzakre/10/
The scroll bar appears!

kinimesi commented 6 years ago

@youyaochi should be fixed in the unstable branch. Can you please verify and close? Thanks.

kinimesi commented 6 years ago

To someone encounter this problem, I fixed it by adding this style:

#graph > canvas {
    position: absolute; 
    top: 0px; 
    left: 0px;
}

This solution would not work properly: turn draw grid on, then turn it off. Now, reduce the size of the browser window, scrollbar will appear.

egoag commented 6 years ago

I built the unstable branch and it worked perfectly :)