mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 14:04:43 -04:00
Implement shrink option (#376)
* Add shrink option that allow change default shrink Shrink option allow to scale the godot application. This path enable dynamic change of this value in the options. * Fix the computation of cursor location For an unknown reason the function get_local_mouse_position return incorrect current_pixel when shrink is not 1. This path compute the transformation manually and povide correct values for any shrink value.
This commit is contained in:
parent
613dc9f0c8
commit
279228daba
5 changed files with 68 additions and 6 deletions
|
@ -50,7 +50,10 @@ func _input(event : InputEvent) -> void:
|
|||
# elif not get_viewport_rect().has_point(event.position):
|
||||
# return
|
||||
|
||||
current_pixel = get_local_mouse_position() + location
|
||||
#current_pixel = get_local_mouse_position() + location
|
||||
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
|
||||
|
||||
if Global.has_focus:
|
||||
update()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue