refactoring to introduce other platforms
make plain rect work on canvas