1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Add snapping distance slider in the preferences

This commit is contained in:
Emmanouil Papadeas 2023-04-18 17:20:13 +03:00
parent 9d848c4f68
commit d04aa5ee56
4 changed files with 71 additions and 1 deletions

View file

@ -1215,6 +1215,18 @@ msgstr ""
msgid "A color of ruler guides displayed on the canvas"
msgstr ""
#. Found in the Preferences, in the Canvas tab. Refers to grid and guide snapping.
msgid "Snapping"
msgstr ""
#. Found in the Preferences, in the Canvas tab. Refers to grid and guide snapping.
msgid "Snapping distance:"
msgstr ""
#. Found in the Preferences, in the Canvas tab. Refers to grid and guide snapping. Hint tooltip of the snapping distance slider.
msgid "This is the distance in pixels where guide and grip snapping gets activated."
msgstr ""
msgid "Grid"
msgstr ""

View file

@ -91,6 +91,7 @@ var right_tool_color := Color("fd6d14")
var default_width := 64
var default_height := 64
var default_fill_color := Color(0, 0, 0, 0)
var snapping_distance := 32.0
var grid_type = GridTypes.CARTESIAN
var grid_size := Vector2(2, 2)
var isometric_grid_size := Vector2(16, 8)
@ -135,7 +136,6 @@ var draw_pixel_grid := false
var show_rulers := true
var show_guides := true
var show_mouse_guides := false
var snapping_distance := 32.0
var snap_to_rectangular_grid := false
var snap_to_guides := false
var snap_to_perspective_guides := false

View file

@ -35,6 +35,7 @@ var preferences := [
Preference.new("default_height", "Image/ImageOptions/ImageDefaultHeight", "value"),
Preference.new("default_fill_color", "Image/ImageOptions/DefaultFillColor", "color"),
Preference.new("smooth_zoom", "Canvas/ZoomOptions/SmoothZoom", "pressed"),
Preference.new("snapping_distance", "Canvas/SnappingOptions/DistanceValue", "value"),
Preference.new("grid_type", "Canvas/GridOptions/GridType", "selected"),
Preference.new("grid_size", "Canvas/GridOptions/GridSizeValue", "value"),
Preference.new("isometric_grid_size", "Canvas/GridOptions/IsometricGridSizeValue", "value"),

View file

@ -470,6 +470,63 @@ mouse_default_cursor_shape = 2
size_flags_horizontal = 3
color = Color( 0.63, 0.13, 0.94, 1 )
[node name="SnappingHeader" type="HBoxContainer" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Canvas"]
margin_top = 88.0
margin_right = 486.0
margin_bottom = 102.0
custom_constants/separation = 0
[node name="SnappingLabel" type="Label" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Canvas/SnappingHeader"]
margin_right = 27.0
margin_bottom = 14.0
theme_type_variation = "Header"
text = "Snapping"
[node name="HSeparator" type="HSeparator" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Canvas/SnappingHeader"]
margin_left = 27.0
margin_right = 486.0
margin_bottom = 14.0
size_flags_horizontal = 3
[node name="SnappingOptions" type="GridContainer" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Canvas"]
margin_top = 64.0
margin_right = 486.0
margin_bottom = 84.0
custom_constants/vseparation = 4
custom_constants/hseparation = 4
columns = 3
[node name="DistanceLabel" type="Label" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Canvas/SnappingOptions"]
margin_top = 3.0
margin_right = 161.0
margin_bottom = 17.0
rect_min_size = Vector2( 110, 0 )
hint_tooltip = "This is the distance in pixels where guide and grip snapping gets activated."
mouse_filter = 0
size_flags_horizontal = 3
text = "Snapping distance:"
[node name="DistanceValue" type="TextureProgress" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Canvas/SnappingOptions"]
margin_top = 294.0
margin_right = 6.0
margin_bottom = 300.0
hint_tooltip = "This is the distance in pixels where guide and grip snapping gets activated."
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
theme_type_variation = "ValueSlider"
min_value = 1.0
max_value = 255.0
value = 32.0
allow_greater = true
nine_patch_stretch = true
stretch_margin_left = 3
stretch_margin_top = 3
stretch_margin_right = 3
stretch_margin_bottom = 3
script = ExtResource( 8 )
suffix = "px"
snap_step = 10.0
[node name="GridHeader" type="HBoxContainer" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Canvas"]
margin_top = 88.0
margin_right = 486.0