Back to normal size after fittoscreen

Dear Friends,

Greetings, how can i bring back to initial size and shape of the diagram after fittoscreen. I mean if i click a button(fittoscreen) screen is getting fit in to the screen. Then if i click another button (normal) it should go back to normal size as before.

Pls help me to get this.

Thanks and Regards,
Syed Abdul Rahim

Just call the CommandHandler | GoJS API command again.

You can try it in any diagram by typing Shift-Z repeatedly.

Dear Mr.Walter,
Greetings! i tried again…
diagram.zoomToFit(diagram.documentBounds); & diagram.resetZoom(1)

but not working… only short cuts (shift+z & ctrl+0 ) is working fine…

Diagram.zoomToFit and CommandHandler.zoomToFit are different. You need to use the CommandHandler (which is what Shift-Z does).