Skip to content

Commit

Permalink
Merge branch 'flame-engine#71-exporter'
Browse files Browse the repository at this point in the history
  • Loading branch information
benni-tec committed Nov 7, 2023
2 parents 033d2df + 1b366e9 commit 455736d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/tiled/lib/src/tileset/tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,12 @@ class Tile with Exportable {
String? get class_ => type;

factory Tile.parse(Parser parser) {
final image = parser.getSingleChildOrNullAs('image', TiledImage.parse);
final x = parser.getDoubleOrNull('x');
final y = parser.getDoubleOrNull('y');
final width = parser.getDoubleOrNull('width');
final height = parser.getDoubleOrNull('height');

final imageRect = [image, x, y, width, height].contains(null)
final imageRect = [x, y, width, height].contains(null)
? null
: Rectangle(x!, y!, width!, height!);

Expand All @@ -74,7 +73,7 @@ class Tile with Exportable {
.map((str) => str.isEmpty ? null : int.parse(str))
.toList() ??
[],
image: image,
image: parser.getSingleChildOrNullAs('image', TiledImage.parse),
imageRect: imageRect,
objectGroup: parser.getSingleChildOrNullAs('objectgroup', Layer.parse),
animation: parser.formatSpecificParsing(
Expand Down

0 comments on commit 455736d

Please sign in to comment.