Skip to content

Commit

Permalink
temporal fix to removeChild during update() phase.
Browse files Browse the repository at this point in the history
  • Loading branch information
Roi Peker committed Jul 26, 2022
1 parent d4c10bf commit 6a46d1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/src/display/display_object_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ abstract class GDisplayObjectContainer extends GDisplayObject {
@override
void update(double delta) {
super.update(delta);
for (var child in children) {
final tmp = List.unmodifiable(children);
for (var child in tmp) {
child.update(delta);
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/src/math.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ abstract class Math {
/// Returns the floor of the number or expression specified in the parameter
/// `value`.
/// Parameter `keepDouble` enforces the return type to be `double`.
static num? floor(double value, [bool keepDouble = true]) {
static num floor(double value, [bool keepDouble = true]) {
return keepDouble ? value.floorToDouble() : value.floor();
}

/// Rounds the value of the parameter `value` up or down to the nearest
/// integer and returns the value.
/// Parameter `keepDouble` enforces the return type to be `double`.
static num? round(double value, [bool keepDouble = true]) {
static num round(double value, [bool keepDouble = true]) {
return keepDouble ? value.roundToDouble() : value.round();
}

Expand Down

0 comments on commit 6a46d1b

Please sign in to comment.