1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-02-20 12:33:14 +00:00

Minor changes to the shrink option

This commit is contained in:
Manolis Papadeas 2020-11-07 19:12:31 +02:00
parent 279228daba
commit bd10680f63
4 changed files with 6 additions and 6 deletions

View file

@ -66,9 +66,9 @@ func setup_application_window_size() -> void:
return
# Set a minimum window size to prevent UI elements from collapsing on each other.
OS.min_window_size = Vector2(1024, 576)
get_tree().set_screen_stretch(SceneTree.STRETCH_MODE_DISABLED,
SceneTree.STRETCH_ASPECT_IGNORE, Vector2(1014,576), Global.shrink)
SceneTree.STRETCH_ASPECT_IGNORE, Vector2(1024,576), Global.shrink)
# Restore the window position/size if values are present in the configuration cache
if Global.config_cache.has_section_key("window", "screen"):

View file

@ -185,4 +185,4 @@ func _on_ShrinkApplyButton_pressed():
SceneTree.STRETCH_ASPECT_IGNORE, Vector2(1014,576), Global.shrink)
Global.preferences_dialog.popup_centered(Vector2(400, 280))
Global.camera.zoom_100()

View file

@ -8,7 +8,6 @@
[sub_resource type="ButtonGroup" id=1]
[node name="PreferencesDialog" type="AcceptDialog"]
visible = true
margin_left = -3.0
margin_top = 9.0
margin_right = 419.0

View file

@ -50,10 +50,11 @@ func _input(event : InputEvent) -> void:
# elif not get_viewport_rect().has_point(event.position):
# return
#current_pixel = get_local_mouse_position() + location
# Do not use self.get_local_mouse_position() because it return unexpected
# 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
current_pixel = tmp_transform.basis_xform(tmp_position) + tmp_transform.origin + location
if Global.has_focus:
update()