Improve performance when zooming and panning diagrams