richsmith / sexytopo

The SexyTopo cave surveying app for Android
GNU General Public License v3.0
30 stars 13 forks source link

Create a cache of the graph view bitmap for use when panning #144

Open danielworkman opened 3 years ago

danielworkman commented 3 years ago

At present a full redraw of the graph is always performed when panning the view. It should be possible via the following technique to simply move the already calculated image around the view rather than recalculating the full layout: https://stackoverflow.com/a/13550808

richsmith commented 3 years ago

The way it works at the moment isn't very efficient but I'm not sure if drawing the entire survey to a bitmap is the best approach.

Presumably you'd redraw on changing zoom level or major editing changes. It could be a ginormous bitmap if you zoom in to max detail on a big survey. At the moment there is some calculation done so only things that are potentially onscreen get drawn.

Caching the survey image might be the way forward but needs some thought.

danielworkman commented 3 years ago

Yes this approach would work for panning and panning only. Depends whether that specific area of the app has been sluggish enough to warrant such a targeted fix - I haven't used it enough to know yet