mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-14 09:46:01 -07:00
bugfix: Fix trick play overflow (#186)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
0ae613a666
commit
c845184c53
2 changed files with 5 additions and 8 deletions
|
|
@ -268,10 +268,10 @@ class _ChapterProgressSliderState extends ConsumerState<VideoProgressBar> {
|
||||||
final chapter = (currentStream?.chapters ?? []).getChapterFromDuration(currentDuration);
|
final chapter = (currentStream?.chapters ?? []).getChapterFromDuration(currentDuration);
|
||||||
final trickPlay = currentStream?.trickPlay;
|
final trickPlay = currentStream?.trickPlay;
|
||||||
final screenWidth = MediaQuery.of(context).size.width;
|
final screenWidth = MediaQuery.of(context).size.width;
|
||||||
final calculatedPosition = _chapterPosition.clamp(-50, screenWidth - (chapterCardWidth + 45)).toDouble();
|
final calculatedPosition = _chapterPosition;
|
||||||
final offsetDifference = _chapterPosition - calculatedPosition;
|
final offsetDifference = _chapterPosition - calculatedPosition;
|
||||||
return Positioned(
|
return Positioned(
|
||||||
left: calculatedPosition,
|
left: calculatedPosition.clamp(-10, screenWidth - (chapterCardWidth + 45)),
|
||||||
child: IgnorePointer(
|
child: IgnorePointer(
|
||||||
child: AnimatedOpacity(
|
child: AnimatedOpacity(
|
||||||
opacity: visible ? 1 : 0,
|
opacity: visible ? 1 : 0,
|
||||||
|
|
|
||||||
|
|
@ -103,19 +103,16 @@ class _TrickPlayPainter extends CustomPainter {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void paint(Canvas canvas, Size size) {
|
void paint(Canvas canvas, Size size) {
|
||||||
// Define the source rectangle from the image
|
|
||||||
Rect srcRect = Rect.fromLTWH(
|
Rect srcRect = Rect.fromLTWH(
|
||||||
offset.dx,
|
offset.dx,
|
||||||
offset.dy,
|
offset.dy,
|
||||||
model.width.toDouble(),
|
model.width.toDouble(),
|
||||||
model.height.toDouble(),
|
model.height.toDouble(),
|
||||||
); // Adjust these values to control the part of the image to display
|
);
|
||||||
|
|
||||||
// Define the destination rectangle on the canvas
|
Paint paint = Paint()..filterQuality = FilterQuality.high;
|
||||||
Rect dstRect = Rect.fromLTWH(0, 0, size.width, size.height);
|
Rect dstRect = Rect.fromLTWH(0, 0, size.width, size.height);
|
||||||
|
canvas.drawImageRect(image, srcRect, dstRect, paint);
|
||||||
// Draw the image part onto the canvas
|
|
||||||
canvas.drawImageRect(image, srcRect, dstRect, Paint());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue