refactoring: each shape has its own panel, undo/redo still buggy though