Skip to content

Conversation

Variable-ind
Copy link
Contributor

An old commit for 0.4: 8fadacd introduced theundos variable at 3 important places in Canvas.gd

These were later removed/replaced by better alternatives (see below)
This PR removes all the other remaining traces of undos variable.

(The 3 important places and the commits that remove them)


# If we're already pressing a mouse button and we haven't handled undo yet,...
    #. .. it means that the cursor was outside the canvas. Then, ...
    # simulate "just pressed" logic the moment the cursor gets inside the canvas

    # Or, if we're making a line. This is used for handling undo/redo for lines...
    # ...that go outside the canvas
    if Input.is_action_pressed("left_mouse") || Input.is_action_pressed("right_mouse"):
        if (mouse_in_canvas && Global.undos < Global.undo_redo.get_version()) || is_making_line:
            mouse_pressed = true

The need for this section was removed by bda9e62#diff-fda2b27bbbd524f0edab9f12f5a93963e7eb070bebc1672ad9d3dbc144d2560e


func handle_redo(
    _action: String, project: Project = Global.current_project, layer_index := -2, frame_index := -2
) -> void:
    can_undo = true
    if project.undos < project.undo_redo.get_version():
        return

The need for this segment was removed by f7ef4a4


        if can_handle || current_project.undos == current_project.undo_redo.get_version():
            if previous_action != -1 && previous_action != Global.Tools.RECTSELECT && current_action != Global.Tools.COLORPICKER && current_action != Global.Tools.ZOOM:
                handle_redo("Draw")

    handle_tools(current_mouse_button, current_action, mouse_pos, can_handle)

The need for this segment was removed by #281 (sub-commit 789b2b0bf181f324655cbd9b6313477109af596a)

Copy link
Member

@OverloadedOrama OverloadedOrama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@OverloadedOrama OverloadedOrama merged commit 7d8680a into Orama-Interactive:master Aug 31, 2025
4 checks passed
@Variable-ind Variable-ind deleted the remove-spare-undos branch August 31, 2025 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants