mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 21:04:43 -04:00
Added SymmetryGuides
Two special guides - one horizontal and one vertical - that let you change the axis of symmetry for mirroring. On the next commit(s) I will make them visible only if mirroring is toggled on. Almost solves #133
This commit is contained in:
parent
7529e967e3
commit
9fa91ffd8e
7 changed files with 77 additions and 18 deletions
|
@ -129,8 +129,8 @@ func fill_in_color(position : Vector2) -> void:
|
|||
|
||||
func fill_in_area(position : Vector2) -> void:
|
||||
var project : Project = Global.current_project
|
||||
var mirror_x = project.size.x - project.x_symmetry_point - position.x
|
||||
var mirror_y = project.size.y - project.y_symmetry_point - position.y
|
||||
var mirror_x = project.x_symmetry_point - position.x
|
||||
var mirror_y = project.y_symmetry_point - position.y
|
||||
var mirror_x_inside : bool = mirror_x >= project.x_min and mirror_x <= project.x_max - 1
|
||||
var mirror_y_inside : bool = mirror_y >= project.y_min and mirror_y <= project.y_max - 1
|
||||
|
||||
|
|
|
@ -269,8 +269,8 @@ func draw_tool_brush(position : Vector2) -> void:
|
|||
dst = dst_rect.position
|
||||
|
||||
var project : Project = Global.current_project
|
||||
var mirror_x = project.size.x - (project.x_symmetry_point + 1) - dst.x - src_rect.size.x
|
||||
var mirror_y = project.size.y - (project.y_symmetry_point + 1) - dst.y - src_rect.size.y
|
||||
var mirror_x = (project.x_symmetry_point + 1) - dst.x - src_rect.size.x
|
||||
var mirror_y = (project.y_symmetry_point + 1) - dst.y - src_rect.size.y
|
||||
var mirror_x_inside : bool = mirror_x >= project.x_min and mirror_x <= project.x_max - 1
|
||||
var mirror_y_inside : bool = mirror_y >= project.y_min and mirror_y <= project.y_max - 1
|
||||
|
||||
|
@ -279,7 +279,7 @@ func draw_tool_brush(position : Vector2) -> void:
|
|||
_draw_brush_image(_mirror_brushes.x, _flip_rect(src_rect, size, true, false), Vector2(mirror_x, dst.y))
|
||||
if tool_slot.vertical_mirror and mirror_y_inside:
|
||||
_draw_brush_image(_mirror_brushes.xy, _flip_rect(src_rect, size, true, true), Vector2(mirror_x, mirror_y))
|
||||
if tool_slot.vertical_mirror and mirror_x_inside:
|
||||
if tool_slot.vertical_mirror and mirror_y_inside:
|
||||
_draw_brush_image(_mirror_brushes.y, _flip_rect(src_rect, size, false, true), Vector2(dst.x, mirror_y))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue