Skip to content

Commit

Permalink
Revert using Image.rotate_90() from the previous commit
Browse files Browse the repository at this point in the history
Image.rotate_90() is also changing the size of the image, which we don't want to, at least not yet
  • Loading branch information
OverloadedOrama committed Mar 2, 2024
1 parent 4a404b2 commit b0a8ad1
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions src/Autoload/DrawingAlgos.gd
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,8 @@ func scale_3x(sprite: Image, tol := 50.0) -> Image:
func rotxel(sprite: Image, angle: float, pivot: Vector2) -> void:
if is_zero_approx(angle) or is_equal_approx(angle, TAU):
return
if is_equal_approx(angle, PI / 2.0):
sprite.rotate_90(CLOCKWISE)
return
if is_equal_approx(angle, 3.0 * PI / 2.0):
sprite.rotate_90(COUNTERCLOCKWISE)
if is_equal_approx(angle, PI / 2.0) or is_equal_approx(angle, 3.0 * PI / 2.0):
nn_rotate(sprite, angle, pivot)
return
if is_equal_approx(angle, PI):
sprite.rotate_180()
Expand Down Expand Up @@ -408,11 +405,8 @@ func rotxel(sprite: Image, angle: float, pivot: Vector2) -> void:
func fake_rotsprite(sprite: Image, angle: float, pivot: Vector2) -> void:
if is_zero_approx(angle) or is_equal_approx(angle, TAU):
return
if is_equal_approx(angle, PI / 2.0):
sprite.rotate_90(CLOCKWISE)
return
if is_equal_approx(angle, 3.0 * PI / 2.0):
sprite.rotate_90(COUNTERCLOCKWISE)
if is_equal_approx(angle, PI / 2.0) or is_equal_approx(angle, 3.0 * PI / 2.0):
nn_rotate(sprite, angle, pivot)
return
if is_equal_approx(angle, PI):
sprite.rotate_180()
Expand All @@ -428,12 +422,6 @@ func fake_rotsprite(sprite: Image, angle: float, pivot: Vector2) -> void:
func nn_rotate(sprite: Image, angle: float, pivot: Vector2) -> void:
if is_zero_approx(angle) or is_equal_approx(angle, TAU):
return
if is_equal_approx(angle, PI / 2.0):
sprite.rotate_90(CLOCKWISE)
return
if is_equal_approx(angle, 3.0 * PI / 2.0):
sprite.rotate_90(COUNTERCLOCKWISE)
return
if is_equal_approx(angle, PI):
sprite.rotate_180()
return
Expand Down

0 comments on commit b0a8ad1

Please sign in to comment.