diff --git a/src/Autoload/Tools.gd b/src/Autoload/Tools.gd index 0863cfb40..c8d5a6f8e 100644 --- a/src/Autoload/Tools.gd +++ b/src/Autoload/Tools.gd @@ -169,6 +169,10 @@ func handle_draw(position : Vector2, event : InputEvent) -> void: if not (Global.can_draw and Global.has_focus): return + var draw_pos := position + if Global.mirror_view: + draw_pos.x = Global.current_project.size.x - position.x - 1 + if event is InputEventWithModifiers: control = event.control shift = event.shift @@ -178,9 +182,9 @@ func handle_draw(position : Vector2, event : InputEvent) -> void: if event.button_index in [BUTTON_LEFT, BUTTON_RIGHT]: if event.pressed and _active_button == -1: _active_button = event.button_index - _slots[_active_button].tool_node.draw_start(position) + _slots[_active_button].tool_node.draw_start(draw_pos) elif not event.pressed and event.button_index == _active_button: - _slots[_active_button].tool_node.draw_end(position) + _slots[_active_button].tool_node.draw_end(draw_pos) _active_button = -1 if event is InputEventMouseMotion: @@ -193,7 +197,7 @@ func handle_draw(position : Vector2, event : InputEvent) -> void: _slots[BUTTON_LEFT].tool_node.cursor_move(position) _slots[BUTTON_RIGHT].tool_node.cursor_move(position) if _active_button != -1: - _slots[_active_button].tool_node.draw_move(position) + _slots[_active_button].tool_node.draw_move(draw_pos) var project : Project = Global.current_project var text := "[%s×%s]" % [project.size.x, project.size.y] diff --git a/src/Tools/Draw.gd b/src/Tools/Draw.gd index 88ef126a5..19d1dbda1 100644 --- a/src/Tools/Draw.gd +++ b/src/Tools/Draw.gd @@ -258,8 +258,6 @@ func draw_tool_circle(position : Vector2, fill := false) -> void: func draw_tool_brush(position : Vector2) -> void: var project : Project = Global.current_project - if Global.mirror_view: - position.x = project.size.x - position.x if project.tile_mode and project.get_tile_mode_rect().has_point(position): position = position.posmodv(project.size) @@ -334,8 +332,6 @@ func draw_indicator_at(position : Vector2, offset : Vector2, color : Color) -> v func _set_pixel(position : Vector2) -> void: var project : Project = Global.current_project - if Global.mirror_view: - position.x = project.size.x - position.x - 1 if project.tile_mode and project.get_tile_mode_rect().has_point(position): position = position.posmodv(project.size)