[DF-1294] Add tilemask editing. Fixes in updated rect calculations. Small fixes