paperjs/paper.js — pull request #241 by chrisbarmonde (2013-06-21 02:17:22+00:00)
Title: Fix project.clear()

Because of the way Base.splice() works with reindexing the lists, if the layers list is run from 0 through the end, it will only process half the list (because the reindexing changes the indexes that exist in the list). Instead, we can just run through it from the end to the beginning.

Also added a test to double-check this works.