@@ -32,6 +32,9 @@ var _settings: Common.Settings = Common.get_static(Common.Statics.SETTINGS)
32
32
33
33
func _init (title : String , icon_name : String ).(title , icon_name ) -> void :
34
34
EDSCALE = Common .get_static (Common .Statics .EDITOR_SCALE )
35
+ var zoom_step_factor : float = _settings .palette_zoom_step_factor
36
+ if zoom_step_factor == 0 :
37
+ zoom_step_factor = 1.25 # default value
35
38
var tb = TreeBuilder .tree (self )
36
39
37
40
tb .node (self ).with_children ([
@@ -69,7 +72,7 @@ func _init(title: String, icon_name: String).(title, icon_name) -> void:
69
72
hint_tooltip = "Zoom Out" ,
70
73
focus_mode = FOCUS_NONE ,
71
74
shortcut = Common .create_shortcut (KEY_MASK_CMD | KEY_MINUS ),
72
- }).connected ("pressed" , "__zoom_content" , [_settings . palette_zoom_step_factor ]),
75
+ }).connected ("pressed" , "__zoom_content" , [zoom_step_factor ]),
73
76
tb .node (ToolButton .new (), "__zoom_reset_button" ).with_props ({
74
77
hint_tooltip = "Zoom Reset" ,
75
78
focus_mode = FOCUS_NONE ,
@@ -82,7 +85,7 @@ func _init(title: String, icon_name: String).(title, icon_name) -> void:
82
85
hint_tooltip = "Zoom In" ,
83
86
focus_mode = FOCUS_NONE ,
84
87
shortcut = Common .create_shortcut (KEY_MASK_CMD | KEY_PLUS ),
85
- }).connected ("pressed" , "__zoom_content" , [1 / _settings . palette_zoom_step_factor ]),
88
+ }).connected ("pressed" , "__zoom_content" , [1 / zoom_step_factor ]),
86
89
]),
87
90
tb .node (ToolButton .new (), "__center_view_button" ).with_props ({
88
91
icon = Common .get_icon ("center_view" ),
@@ -216,6 +219,9 @@ func __set_content_zoom(zoom: float, origin: Vector2 = __get_content_panel_cente
216
219
var __warping : bool
217
220
var __content_dragging_button : int
218
221
func __on_content_panel_gui_input (event : InputEvent ) -> void :
222
+ var zoom_step_factor : float = _settings .palette_zoom_step_factor
223
+ if zoom_step_factor == 0 :
224
+ zoom_step_factor = 1.25 # default value
219
225
if _content == null :
220
226
return
221
227
if event is InputEventMouse :
@@ -233,10 +239,10 @@ func __on_content_panel_gui_input(event: InputEvent) -> void:
233
239
else :
234
240
match event .button_index :
235
241
BUTTON_WHEEL_UP :
236
- __zoom_content (_settings . palette_zoom_step_factor , event .position )
242
+ __zoom_content (zoom_step_factor , event .position )
237
243
return
238
244
BUTTON_WHEEL_DOWN :
239
- __zoom_content (1 / _settings . palette_zoom_step_factor , event .position )
245
+ __zoom_content (1 / zoom_step_factor , event .position )
240
246
return
241
247
242
248
elif event is InputEventMouseMotion :
0 commit comments