Skip to content

Commit

Permalink
Don't change brush size when resizing the timeline cels and the palet…
Browse files Browse the repository at this point in the history
…te swatches
  • Loading branch information
OverloadedOrama committed Nov 11, 2024
1 parent b0b1361 commit ce738f0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/Palette/PaletteScroll.gd
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,4 @@ func _on_PaletteScroll_gui_input(event: InputEvent) -> void:
return
resize_grid()
set_sliders(palette_grid.current_palette, palette_grid.grid_window_origin + scroll_vector)
get_window().set_input_as_handled()
12 changes: 9 additions & 3 deletions src/UI/Nodes/ValueSlider.gd
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,21 @@ func _notification(what: int) -> void:
_reset_display(false)


func _input(event: InputEvent) -> void:
func _unhandled_input(event: InputEvent) -> void:
if not editable or not is_visible_in_tree():
return
if event.is_action_pressed(global_increment_action, true):
if (
not global_increment_action.is_empty()
and event.is_action_pressed(global_increment_action, true)
):
if snap_by_default:
value += step if event.ctrl_pressed else snap_step
else:
value += snap_step if event.ctrl_pressed else step
elif event.is_action_pressed(global_decrement_action, true):
elif (
not global_decrement_action.is_empty()
and event.is_action_pressed(global_decrement_action, true)
):
if snap_by_default:
value -= step if event.ctrl_pressed else snap_step
else:
Expand Down
1 change: 1 addition & 0 deletions src/UI/Timeline/AnimationTimeline.gd
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ func _input(event: InputEvent) -> void:
if timeline_rect.has_point(mouse_pos):
if Input.is_key_pressed(KEY_CTRL):
cel_size += (2 * int(event.is_action("zoom_in")) - 2 * int(event.is_action("zoom_out")))
get_viewport().set_input_as_handled()


func reset_settings() -> void:
Expand Down

0 comments on commit ce738f0

Please sign in to comment.