mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 15:44:42 -04:00
Changed how isometric grid is drawn
Instead of drawing individual lines, execute draw_isometric_tile() multiple times. What this method does is basically draws a single isometric tile, which then gets repeated for the entire canvas size. Also moved all the grid logic to a new script, which gets updated less often that Canvas.gd, for optimization purposes. Works better than the previous method, although it might be a bit slower, and currently does not work well if the canvas size is not divisible by the grid size. For now, it only gets affected by the grid width. Changing grid height has no effect.
This commit is contained in:
parent
39808082b6
commit
35b2c201ae
7 changed files with 69 additions and 68 deletions
|
@ -310,6 +310,8 @@ func undo(_frame_index := -1, _layer_index := -1, project : Project = current_pr
|
|||
|
||||
if action_name == "Scale":
|
||||
canvas.camera_zoom()
|
||||
Global.canvas.grid.isometric_polylines.clear()
|
||||
Global.canvas.grid.update()
|
||||
|
||||
elif "Frame" in action_name:
|
||||
# This actually means that frames.size is one, but it hasn't been updated yet
|
||||
|
@ -338,6 +340,8 @@ func redo(_frame_index := -1, _layer_index := -1, project : Project = current_pr
|
|||
|
||||
if action_name == "Scale":
|
||||
canvas.camera_zoom()
|
||||
Global.canvas.grid.isometric_polylines.clear()
|
||||
Global.canvas.grid.update()
|
||||
|
||||
elif "Frame" in action_name:
|
||||
if project.frames.size() == 1: # Stop animating
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue