* Cache tile mode rects
* Make TransparentChecker don't calculate tile mode rect on its own
* Minor fixes
- typo
- formatting
- moved unlock() call to the method where matching lock() was called
It now automatically sets the size to the current project's size, has a button to lock aspect ratio, and resizing based on percentage. Some UI changes to CreateNewImage too.
The lock aspect ratio button has been changed from a checkbox to a texture button and the template code has been refactored to use a Template class instead of enums. Only dark icons have been added for now.
* Move get_tile_mode_rect() method to the Project class
* Refactored isometric grid
Now it should be drawn properly in the target rect.
Settings (in pixels):
- cell's AABB size,
- offset from the canvas origin.
* Draw grid only over the Canvas (when in tiling mode)
* Replace some magic numbers with enums.
It's too easy to break something when adding something new in here. Should be a little harder now.
* Added Pixel Grid.
- Pixel grid is shown only when it's enabled and camera is zoomed close enough.
- Settings: pixel_grid_show_at_zoom (as a percentage because that's what's shown in the settings panel), pixel_grid_color. Default values might need changing.
- To distinguish between grid and pixel grid default settings for grid width, grid height are changed.
- Now both grid and pixel grid are drawn above (after) tile mode. Grid is drawn above (after) pixel grid.
It's Cel's property and thus it changes when frame_changed is called (also layer_changed calls frame_changed on its own).
Co-authored-by: kleonc <kleonc@users.noreply.github.com>
- Now the current frame is drawn to a separate Viewport (with transparent background) taking into account only per layer opacity,
- Tiling is drawn by drawing current frame's ViewportTexture with tile mode opacity applied (using premultiply alpha blending).
Co-authored-by: kleonc <kleonc@users.noreply.github.com>
Instead of having a frame_duration[] array in the Project class. This makes the code much more readable and understandable, using less lines of code and, by avoiding an extra array, we also avoid potential out-of-bound array crashes.
The functionality for the user has not changed, and by testing so far I didn't find any issues.