-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix:
ObjectAlignment
enum names (#74)
Name of some of the enum values of ObjectAlignment were not matching the values from Tiled. As a result, tilesets with topLeft, topRight, bottomLeft and bottomRight alignment couldn't be parsed. https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#tmx-tileset image Another problem that was discovered after fixing the names was with the byName method from the EnumByName extension. That method was not using names from ObjectAlignmentExtension that Tiled defines. To fix that, this PR adds a byName static method for ObjectAlignment which uses the correct names.
- Loading branch information
1 parent
41c9439
commit 628f1f6
Showing
11 changed files
with
96 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -330,7 +330,7 @@ void main() { | |
image: const TiledImage(), | ||
), | ||
], | ||
) | ||
), | ||
], | ||
); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:tiled/tiled.dart'; | ||
|
||
void main() { | ||
group('ObjectAlignment', () { | ||
test('ObjectAlignment.byName', () { | ||
expect( | ||
ObjectAlignment.fromName('unspecified'), | ||
ObjectAlignment.unspecified, | ||
); | ||
expect(ObjectAlignment.fromName('topleft'), ObjectAlignment.topLeft); | ||
expect(ObjectAlignment.fromName('top'), ObjectAlignment.top); | ||
expect(ObjectAlignment.fromName('topright'), ObjectAlignment.topRight); | ||
expect(ObjectAlignment.fromName('left'), ObjectAlignment.left); | ||
expect(ObjectAlignment.fromName('center'), ObjectAlignment.center); | ||
expect(ObjectAlignment.fromName('right'), ObjectAlignment.right); | ||
expect( | ||
ObjectAlignment.fromName('bottomleft'), | ||
ObjectAlignment.bottomLeft, | ||
); | ||
expect(ObjectAlignment.fromName('bottom'), ObjectAlignment.bottom); | ||
expect( | ||
ObjectAlignment.fromName('bottomright'), | ||
ObjectAlignment.bottomRight, | ||
); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: tiled_workspace | ||
|
||
environment: | ||
sdk: ">=3.0.0 <4.0.0" | ||
|
||
dev_dependencies: | ||
melos: ^3.0.0 |