1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-19 01:29:49 +00:00

code changed for github static checks

This commit is contained in:
RorotoSic 2024-03-02 19:21:29 +01:00
parent 10db8f875f
commit 8bbcc21ec6
2 changed files with 24 additions and 17 deletions

View file

@ -59,8 +59,9 @@ func _on_BrushType_pressed() -> void:
if child is GridContainer:
child.columns = columns
Global.brushes_popup.popup(Rect2(pop_position, Vector2(size_x, size_y)))
Tools.flip_rotate.emit(_brush_flip_x, _brush_flip_y, _brush_rotate_90, _brush_rotate_180, _brush_rotate_270)
Tools.flip_rotate.emit(
_brush_flip_x, _brush_flip_y, _brush_rotate_90, _brush_rotate_180, _brush_rotate_270
)
func _on_Brush_selected(brush: Brushes.Brush) -> void:
@ -195,16 +196,16 @@ func update_mirror_brush() -> void:
func update_brush_image_flip_and_rotate() -> void:
if _brush_flip_x == true:
_brush_image.flip_x()
if _brush_flip_y == true:
_brush_image.flip_y()
if _brush_rotate_90 == true:
_brush_image.rotate_90(CLOCKWISE)
if _brush_rotate_180 == true:
_brush_image.rotate_180()
if _brush_rotate_270 == true:
_brush_image.rotate_90(COUNTERCLOCKWISE)
if _brush_flip_x == true:
_brush_image.flip_x()
if _brush_flip_y == true:
_brush_image.flip_y()
if _brush_rotate_90 == true:
_brush_image.rotate_90(CLOCKWISE)
if _brush_rotate_180 == true:
_brush_image.rotate_180()
if _brush_rotate_270 == true:
_brush_image.rotate_90(COUNTERCLOCKWISE)
func update_mask(can_skip := true) -> void:
@ -738,7 +739,6 @@ func _pick_color(pos: Vector2i) -> void:
Tools.assign_color(color, button, false)
func _on_flip_x_toggled(button_pressed: bool) -> void:
_brush_flip_x = button_pressed
update_brush()

View file

@ -2,6 +2,7 @@ extends BaseButton
var brush = Global.brushes_popup.Brush.new()
func _ready() -> void:
Tools.flip_rotate.connect(_flip_rotate_updated)
@ -30,11 +31,17 @@ func _on_BrushButton_mouse_exited() -> void:
if brush.type == Global.brushes_popup.CUSTOM:
$DeleteButton.visible = false
func _flip_rotate_updated(flip_x: bool, flip_y: bool, rotate_90: bool, rotate_180: bool,rotate_270: bool):
func _flip_rotate_updated(
flip_x: bool, flip_y: bool, rotate_90: bool, rotate_180: bool,rotate_270: bool
):
$BrushTexture.set_flip_h(flip_x)
$BrushTexture.set_flip_v(flip_y)
var _rotation = 0
if rotate_90 ==true : _rotation += 90
if rotate_180 ==true : _rotation += 180
if rotate_270 ==true : _rotation += 270
if rotate_90 == true:
_rotation += 90
if rotate_180 == true:
_rotation += 180
if rotate_270 == true:
_rotation += 270
$BrushTexture.rotation_degrees = _rotation