Skip to content
Discussion options

You must be logged in to vote

If you want to resize the elements to fit your paper, you should scale the models rather than scaling the paper (zoom in / out).

For instance:

const b = graph.getBBox();
const s = paper.getArea().maxRectUniformScaleToFit(graph.getBBox(), b.topLeft());
graph.translate(-b.x, -b.y)
graph.getCells().forEach(cell =>  cell.scale(s, s, new g.Point(0,0)))

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by elinake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants