mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
chore: Renaming of Trickplay -> TrickPlay and other cleanups (#130)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
556a33d613
commit
0b7b73134f
9 changed files with 58 additions and 71 deletions
|
|
@ -22,8 +22,8 @@ class TrickPlayModel with _$TrickPlayModel {
|
|||
int get imagesPerTile => tileWidth * tileHeight;
|
||||
|
||||
String? getTile(Duration position) {
|
||||
final int currentIndex = (position.inMilliseconds ~/ interval.inMilliseconds).clamp(0, thumbnailCount);
|
||||
final int indexOfTile = (currentIndex ~/ imagesPerTile).clamp(0, images.length);
|
||||
final int currentIndex = (position.inMilliseconds ~/ interval.inMilliseconds).clamp(0, thumbnailCount - 1);
|
||||
final int indexOfTile = (currentIndex ~/ imagesPerTile).clamp(0, (images.length - 1));
|
||||
return images.elementAtOrNull(indexOfTile);
|
||||
}
|
||||
|
||||
|
|
@ -32,7 +32,10 @@ class TrickPlayModel with _$TrickPlayModel {
|
|||
final int tileIndex = currentIndex % imagesPerTile;
|
||||
final int column = tileIndex % tileWidth;
|
||||
final int row = tileIndex ~/ tileWidth;
|
||||
return Offset((width * column).toDouble(), (height * row).toDouble());
|
||||
return Offset(
|
||||
(width * column).toDouble(),
|
||||
(height * row).toDouble(),
|
||||
);
|
||||
}
|
||||
|
||||
static Map<String, TrickPlayModel> toTrickPlayMap(Map<String, dynamic> map) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue