Fixed an issue where hit didn't cached if a shape was cached before added to a layer. Fix #758