mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 05:14:42 -04:00
Remove unneeded location variables (#425)
Co-authored-by: kleonc <kleonc@users.noreply.github.com>
This commit is contained in:
parent
1b8520c1a9
commit
b1c0344d0b
7 changed files with 22 additions and 27 deletions
|
@ -2,7 +2,6 @@ class_name Canvas
|
|||
extends Node2D
|
||||
|
||||
|
||||
var location := Vector2.ZERO
|
||||
var fill_color := Color(0, 0, 0, 0)
|
||||
var current_pixel := Vector2.ZERO
|
||||
var can_undo := true
|
||||
|
@ -40,7 +39,7 @@ func _draw() -> void:
|
|||
for i in range(Global.current_project.layers.size()):
|
||||
var modulate_color := Color(1, 1, 1, current_cels[i].opacity)
|
||||
if Global.current_project.layers[i].visible: # if it's visible
|
||||
draw_texture(current_cels[i].image_texture, location, modulate_color)
|
||||
draw_texture(current_cels[i].image_texture, Vector2.ZERO, modulate_color)
|
||||
|
||||
if Global.onion_skinning:
|
||||
onion_skinning()
|
||||
|
@ -65,7 +64,7 @@ func _input(event : InputEvent) -> void:
|
|||
# value when shrink parameter is not equal to one. At godot version 3.2.3
|
||||
var tmp_transform = get_canvas_transform().affine_inverse()
|
||||
var tmp_position = Global.main_viewport.get_local_mouse_position()
|
||||
current_pixel = tmp_transform.basis_xform(tmp_position) + tmp_transform.origin + location
|
||||
current_pixel = tmp_transform.basis_xform(tmp_position) + tmp_transform.origin
|
||||
|
||||
if Global.has_focus:
|
||||
update()
|
||||
|
@ -237,7 +236,7 @@ func onion_skinning() -> void:
|
|||
for layer in Global.current_project.frames[Global.current_project.current_frame - i].cels:
|
||||
if Global.current_project.layers[layer_i].visible:
|
||||
color.a = 0.6 / i
|
||||
draw_texture(layer.image_texture, location, color)
|
||||
draw_texture(layer.image_texture, Vector2.ZERO, color)
|
||||
layer_i += 1
|
||||
|
||||
# Future
|
||||
|
@ -253,5 +252,5 @@ func onion_skinning() -> void:
|
|||
for layer in Global.current_project.frames[Global.current_project.current_frame + i].cels:
|
||||
if Global.current_project.layers[layer_i].visible:
|
||||
color.a = 0.6 / i
|
||||
draw_texture(layer.image_texture, location, color)
|
||||
draw_texture(layer.image_texture, Vector2.ZERO, color)
|
||||
layer_i += 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue