richsmith / sexytopo

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

Create more member leg/splay Paint objects rather than constantly updating #147

Closed danielworkman closed 3 years ago

danielworkman commented 3 years ago
richsmith commented 3 years ago
* Calling `setColor` or `setAlpha` on a `Paint` object has a surprising effect on performance. By creating enough `Paint` member objects for each possible combination we can avoid ever needing to call these methods

* Made the `Path` object a member and now call `reset` before a draw rather than recreating for each path needed

* Unfortunately I still need to do a fiddle for the dashed path style but that could be looked at later

* I bumped the dash style to `5, 5` as I was finding it hard to disambiguate between dashed/non-dashed - happy for it to go back as it was

* The `baseAlpha` was being unused within `drawLegs`, I assume the intention was that linked surveys should override the fade non-active logic and always be drawn faded?

Ah yes, all seems sensible :slightly_smiling_face: Good job.