Canvas improvements #5115

Merged
merged 11 commits into from Nov 18, 2016

Projects

None yet

2 participants

@perliedman
Member
perliedman commented Nov 18, 2016 edited

This makes a lot of changes to how canvas is handled. Primarily:

  • Adds canvas support for bringToFront and bringToBack (close #974)
  • Fixes canvas sometimes not redrawing properly (close #5093)
  • Fixes canvas calling _project on a layer that is no longer on the map (close #5097)
  • Fixes canvas not rendering layers which moves significantly (close #5114)
  • Theoretically improves performance when redrawing layers on canvas, by using clearRect instead of drawing all layers in the paint region twice

This makes some pretty significant changes to how canvas is handled internally, so a thorough review would be good.

@IvanSanchez

LGTM.

@IvanSanchez IvanSanchez merged commit 4c48446 into master Nov 18, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@DiogoMCampos DiogoMCampos added a commit to DiogoMCampos/Leaflet that referenced this pull request Dec 18, 2016
@perliedman @DiogoMCampos perliedman + DiogoMCampos Canvas improvements (#5115)
* WIP refactor canvas clear

* Fix clearing bounds, remov unnecessary code

* Refactor redraw logic

* Remove flicker on update

* Fix code style

* Add support for layer ordering with bringToFront/bringToBack

* Fix redraw when layer moves

* Add example for moving canvas layers

* Fix code style

* Use layer ordering for mouse events

* Fix removing first or last layer
bc03da7
@DiogoMCampos DiogoMCampos added a commit to DiogoMCampos/Leaflet that referenced this pull request Dec 18, 2016
@perliedman @DiogoMCampos perliedman + DiogoMCampos Canvas improvements (#5115)
* WIP refactor canvas clear

* Fix clearing bounds, remov unnecessary code

* Refactor redraw logic

* Remove flicker on update

* Fix code style

* Add support for layer ordering with bringToFront/bringToBack

* Fix redraw when layer moves

* Add example for moving canvas layers

* Fix code style

* Use layer ordering for mouse events

* Fix removing first or last layer
9641da2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment