Fix hit didn't cached if an shape was cached before adding it to a layer. Fix #758