diff --git a/src/Tools/SelectionTools/EllipseSelect.gd b/src/Tools/SelectionTools/EllipseSelect.gd index d699601cc..1924a8bc4 100644 --- a/src/Tools/SelectionTools/EllipseSelect.gd +++ b/src/Tools/SelectionTools/EllipseSelect.gd @@ -76,21 +76,22 @@ func apply_selection(_position : Vector2) -> void: if _rect.size != Vector2.ZERO: var selection_bitmap_copy : BitMap = project.selection_bitmap.duplicate() set_ellipse(selection_bitmap_copy, _rect.position) + # Handle mirroring if tool_slot.horizontal_mirror: var mirror_x_rect := _rect - mirror_x_rect.position.x = Global.current_project.x_symmetry_point - _rect.position.x - mirror_x_rect.end.x = Global.current_project.x_symmetry_point - _rect.end.x + mirror_x_rect.position.x = Global.current_project.x_symmetry_point - _rect.position.x + 1 + mirror_x_rect.end.x = Global.current_project.x_symmetry_point - _rect.end.x + 1 set_ellipse(selection_bitmap_copy, mirror_x_rect.abs().position) if tool_slot.vertical_mirror: var mirror_xy_rect := mirror_x_rect - mirror_xy_rect.position.y = Global.current_project.y_symmetry_point - _rect.position.y - mirror_xy_rect.end.y = Global.current_project.y_symmetry_point - _rect.end.y + mirror_xy_rect.position.y = Global.current_project.y_symmetry_point - _rect.position.y + 1 + mirror_xy_rect.end.y = Global.current_project.y_symmetry_point - _rect.end.y + 1 set_ellipse(selection_bitmap_copy, mirror_xy_rect.abs().position) if tool_slot.vertical_mirror: var mirror_y_rect := _rect - mirror_y_rect.position.y = Global.current_project.y_symmetry_point - _rect.position.y - mirror_y_rect.end.y = Global.current_project.y_symmetry_point - _rect.end.y + mirror_y_rect.position.y = Global.current_project.y_symmetry_point - _rect.position.y + 1 + mirror_y_rect.end.y = Global.current_project.y_symmetry_point - _rect.end.y + 1 set_ellipse(selection_bitmap_copy, mirror_y_rect.abs().position) project.selection_bitmap = selection_bitmap_copy diff --git a/src/Tools/SelectionTools/RectSelect.gd b/src/Tools/SelectionTools/RectSelect.gd index d413d4ef9..3e147709b 100644 --- a/src/Tools/SelectionTools/RectSelect.gd +++ b/src/Tools/SelectionTools/RectSelect.gd @@ -61,18 +61,18 @@ func draw_preview() -> void: # Handle mirroring if tool_slot.horizontal_mirror: var mirror_x_rect := _rect - mirror_x_rect.position.x = Global.current_project.x_symmetry_point - _rect.position.x - mirror_x_rect.end.x = Global.current_project.x_symmetry_point - _rect.end.x + mirror_x_rect.position.x = Global.current_project.x_symmetry_point - _rect.position.x + 1 + mirror_x_rect.end.x = Global.current_project.x_symmetry_point - _rect.end.x + 1 canvas.draw_rect(mirror_x_rect, Color.black, false) if tool_slot.vertical_mirror: var mirror_xy_rect := mirror_x_rect - mirror_xy_rect.position.y = Global.current_project.y_symmetry_point - _rect.position.y - mirror_xy_rect.end.y = Global.current_project.y_symmetry_point - _rect.end.y + mirror_xy_rect.position.y = Global.current_project.y_symmetry_point - _rect.position.y + 1 + mirror_xy_rect.end.y = Global.current_project.y_symmetry_point - _rect.end.y + 1 canvas.draw_rect(mirror_xy_rect, Color.black, false) if tool_slot.vertical_mirror: var mirror_y_rect := _rect - mirror_y_rect.position.y = Global.current_project.y_symmetry_point - _rect.position.y - mirror_y_rect.end.y = Global.current_project.y_symmetry_point - _rect.end.y + mirror_y_rect.position.y = Global.current_project.y_symmetry_point - _rect.position.y + 1 + mirror_y_rect.end.y = Global.current_project.y_symmetry_point - _rect.end.y + 1 canvas.draw_rect(mirror_y_rect, Color.black, false) canvas.draw_set_transform(canvas.position, canvas.rotation, canvas.scale) @@ -93,18 +93,18 @@ func apply_selection(_position) -> void: # Handle mirroring if tool_slot.horizontal_mirror: var mirror_x_rect := _rect - mirror_x_rect.position.x = Global.current_project.x_symmetry_point - _rect.position.x - mirror_x_rect.end.x = Global.current_project.x_symmetry_point - _rect.end.x + mirror_x_rect.position.x = Global.current_project.x_symmetry_point - _rect.position.x + 1 + mirror_x_rect.end.x = Global.current_project.x_symmetry_point - _rect.end.x + 1 Global.canvas.selection.select_rect(mirror_x_rect.abs(), operation) if tool_slot.vertical_mirror: var mirror_xy_rect := mirror_x_rect - mirror_xy_rect.position.y = Global.current_project.y_symmetry_point - _rect.position.y - mirror_xy_rect.end.y = Global.current_project.y_symmetry_point - _rect.end.y + mirror_xy_rect.position.y = Global.current_project.y_symmetry_point - _rect.position.y + 1 + mirror_xy_rect.end.y = Global.current_project.y_symmetry_point - _rect.end.y + 1 Global.canvas.selection.select_rect(mirror_xy_rect.abs(), operation) if tool_slot.vertical_mirror: var mirror_y_rect := _rect - mirror_y_rect.position.y = Global.current_project.y_symmetry_point - _rect.position.y - mirror_y_rect.end.y = Global.current_project.y_symmetry_point - _rect.end.y + mirror_y_rect.position.y = Global.current_project.y_symmetry_point - _rect.position.y + 1 + mirror_y_rect.end.y = Global.current_project.y_symmetry_point - _rect.end.y + 1 Global.canvas.selection.select_rect(mirror_y_rect.abs(), operation) Global.canvas.selection.commit_undo("Rectangle Select", undo_data)