Level editor

Fix some bugs for Layers and paiting