1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 07:29:49 +00:00

Add reset button to tile mode offsets dialog (#708)

I forgot to implement this requested feature in #707
This commit is contained in:
Grant Moyer 2022-06-21 11:10:59 -04:00 committed by GitHub
parent aadad462b9
commit 8cfdcb5ebc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 4 deletions

View file

@ -70,3 +70,14 @@ func _on_TileModeOffsetsDialog_popup_hide() -> void:
func _on_TileModeOffsetsDialog_item_rect_changed():
if tile_mode:
update_preview()
func _on_Reset_pressed():
var size = Global.current_project.size
tile_mode.tiles.x_basis = Vector2(size.x, 0)
tile_mode.tiles.y_basis = Vector2(0, size.y)
x_basis_x_spinbox.value = size.x
x_basis_y_spinbox.value = 0
y_basis_x_spinbox.value = 0
y_basis_y_spinbox.value = size.y
update_preview()

View file

@ -19,7 +19,7 @@ script = ExtResource( 3 )
margin_left = 8.0
margin_top = 8.0
margin_right = 208.0
margin_bottom = 338.0
margin_bottom = 362.0
[node name="TileModeOffsets" type="Label" parent="VBoxContainer"]
margin_right = 200.0
@ -29,7 +29,7 @@ text = "Tile Mode Offsets"
[node name="OptionsContainer" type="GridContainer" parent="VBoxContainer"]
margin_top = 18.0
margin_right = 200.0
margin_bottom = 126.0
margin_bottom = 150.0
custom_constants/vseparation = 4
custom_constants/hseparation = 2
columns = 2
@ -97,10 +97,16 @@ min_value = -16384.0
max_value = 16384.0
suffix = "px"
[node name="Reset" type="Button" parent="VBoxContainer/OptionsContainer"]
margin_top = 112.0
margin_right = 61.0
margin_bottom = 132.0
text = "Reset"
[node name="AspectRatioContainer" type="AspectRatioContainer" parent="VBoxContainer"]
margin_top = 130.0
margin_top = 154.0
margin_right = 200.0
margin_bottom = 330.0
margin_bottom = 354.0
size_flags_vertical = 3
[node name="Preview" type="Control" parent="VBoxContainer/AspectRatioContainer"]
@ -127,3 +133,4 @@ margin_bottom = 0.0
[connection signal="value_changed" from="VBoxContainer/OptionsContainer/XBasisY" to="." method="_on_XBasisY_value_changed"]
[connection signal="value_changed" from="VBoxContainer/OptionsContainer/YBasisX" to="." method="_on_YBasisX_value_changed"]
[connection signal="value_changed" from="VBoxContainer/OptionsContainer/YBasisY" to="." method="_on_YBasisY_value_changed"]
[connection signal="pressed" from="VBoxContainer/OptionsContainer/Reset" to="." method="_on_Reset_pressed"]