Skip to content

Commit

Permalink
fix: 弹幕传参错误
Browse files Browse the repository at this point in the history
  • Loading branch information
orz12 committed Jan 12, 2025
1 parent 4ae76d2 commit f9d5cf9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/pages/danmaku/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ class PlDanmakuController {
int pos = element.progress ~/ 100; //每0.1秒存储一次
dmSegMap[pos] ??= [];
int i = dmSegMap[pos]!.indexWhere((e) => element.weight > e.weight);
(i > 0 ? dmSegMap[pos]!.insert : dmSegMap[pos]!.add)(i, element);
if (i > 0) {
dmSegMap[pos]!.insert(i, element);
} else {
dmSegMap[pos]!.add(element);
}
}
}
}
Expand Down

0 comments on commit f9d5cf9

Please sign in to comment.