bugfix: Fix trick play overflow (#186)

Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
PartyDonut 2024-12-23 11:43:34 +01:00 committed by GitHub
parent 0ae613a666
commit c845184c53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 8 deletions

View file

@ -103,19 +103,16 @@ class _TrickPlayPainter extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
// Define the source rectangle from the image
Rect srcRect = Rect.fromLTWH(
offset.dx,
offset.dy,
model.width.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);
// Draw the image part onto the canvas
canvas.drawImageRect(image, srcRect, dstRect, Paint());
canvas.drawImageRect(image, srcRect, dstRect, paint);
}
@override