Skip to content

Commit

Permalink
refactor: Rename flip animation method
Browse files Browse the repository at this point in the history
  • Loading branch information
kfischer-okarin committed Jan 12, 2023
1 parent 22b78ff commit 61deecd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/dragon_skeleton/file_formats/aseprite_json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def read_as_animations(json_path)
}
end

def flipped_horizontally(animation)
def flip_animation_horizontally(animation)
{
frames: animation[:frames].map { |frame|
values = frame[:values]
Expand Down
12 changes: 6 additions & 6 deletions tests/lib/dragon_skeleton/file_formats/aseprite_json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_file_formats_aseprite_json_read_as_animations(_args, assert)
assert.equal! animations, expected_animations
end

def test_file_formats_aseprite_json_flipped_horizontally(_args, assert)
def test_file_formats_aseprite_json_flip_animation_horizontally(_args, assert)
animation = Animations.build(
frames: [
{
Expand All @@ -65,8 +65,8 @@ def test_file_formats_aseprite_json_flipped_horizontally(_args, assert)
}
]
)
flipped_animation = FileFormats::AsepriteJson.flipped_horizontally animation
flipped_twice_animation = FileFormats::AsepriteJson.flipped_horizontally flipped_animation
flipped_animation = FileFormats::AsepriteJson.flip_animation_horizontally animation
flipped_twice_animation = FileFormats::AsepriteJson.flip_animation_horizontally flipped_animation

sprite1 = {}
sprite2 = {}
Expand All @@ -79,7 +79,7 @@ def test_file_formats_aseprite_json_flipped_horizontally(_args, assert)
assert.equal! sprite3.flip_horizontally, !sprite2.flip_horizontally, "Flipping twice didn't work"
end

def test_file_formats_aseprite_json_flipped_horizontally_slices(_args, assert)
def test_file_formats_aseprite_json_flip_animation_horizontally_slices(_args, assert)
animation = Animations.build(
frames: [
{
Expand All @@ -96,8 +96,8 @@ def test_file_formats_aseprite_json_flipped_horizontally_slices(_args, assert)
}
]
)
flipped_animation = FileFormats::AsepriteJson.flipped_horizontally animation
flipped_twice_animation = FileFormats::AsepriteJson.flipped_horizontally flipped_animation
flipped_animation = FileFormats::AsepriteJson.flip_animation_horizontally animation
flipped_twice_animation = FileFormats::AsepriteJson.flip_animation_horizontally flipped_animation
flipped_state = Animations.start!({}, animation: flipped_animation)
flipped_twice_state = Animations.start!({}, animation: flipped_twice_animation)

Expand Down

0 comments on commit 61deecd

Please sign in to comment.