Skip to content

Commit 47fbd46

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents b0c4900 + 174425d commit 47fbd46

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

packages/flame_texturepacker/lib/src/texture_packer_atlas.dart

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,15 +265,17 @@ Future<TextureAtlasData> _parse(
265265
var currentPackage = package;
266266
var finalPath = fullPath;
267267

268-
// Check for package path in the full path (which may already include assetsPrefix)
268+
// Check for package path in the full path
269+
//(which may already include assetsPrefix)
269270
const packageKeyword = 'packages/';
270271
final packageIndex = finalPath.indexOf(packageKeyword);
271272
if (packageIndex != -1) {
272273
final subPath = finalPath.substring(packageIndex + packageKeyword.length);
273274
final parts = subPath.split('/');
274275
if (parts.length > 1) {
275276
currentPackage ??= parts[0];
276-
// Clean the path by removing everything up to and including the package name
277+
// Clean the path by removing everything up to
278+
//and including the package name
277279
finalPath = parts.sublist(1).join('/');
278280
}
279281
}
@@ -313,10 +315,12 @@ Future<TextureAtlasData> _parse(
313315
while (lineQueue.isNotEmpty) {
314316
final line = lineQueue.first.trim();
315317

316-
// Check if this line looks like a texture file (has file extension)
318+
// Check if this line looks like a texture file
319+
// (has file extension)
317320
if (_isTextureFile(line)) {
318321
// Peek at the next line to see if it's a region or a new page.
319-
// Regions are followed by properties like 'bounds:', 'rotate:', 'xy:', 'offsets:'.
322+
// Regions are followed by properties
323+
// like 'bounds:', 'rotate:', 'xy:', 'offsets:'.
320324
// Pages are followed by 'size:', 'format:', 'filter:', 'repeat:'.
321325
if (lineQueue.length > 1) {
322326
final nextLine = lineQueue.elementAt(1).trim();
@@ -522,6 +526,7 @@ Region _parseRegion(ListQueue<String> lineQueue, Page page) {
522526
try {
523527
extractedIndex = int.parse(indexMatch.group(1)!);
524528
name = name.substring(0, indexMatch.start);
529+
// ignore: avoid_catches_without_on_clauses
525530
} catch (_) {
526531
// Ignore parsing errors for very large numbers
527532
}

packages/flame_texturepacker/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ environment:
1818
dependencies:
1919
collection: ^1.17.1
2020
cross_file: ^0.3.4+2
21-
flame: ^1.35.0
21+
flame: ^1.36.0
2222
flutter:
2323
sdk: flutter
2424

packages/flame_texturepacker/test/atlas_path_resolution_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ sprite1
157157
'should correctly parse region names with .png and extracted indexes',
158158
() async {
159159
final assets = AssetsCache(bundle: bundle);
160-
final complexAtlasContent = '''
160+
const complexAtlasContent = '''
161161
knight.png
162162
size: 64, 64
163163
filter: Nearest, Nearest

0 commit comments

Comments
 (0)