Skip to content

fix(neon_talk): Request file previews in a sensible resoltion if none is provided #2280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ class TalkRichObjectFilePreview extends StatelessWidget {
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (context, constraints) {
final devicePixelRatio = MediaQuery.of(context).devicePixelRatio;

final maxSize = Size(constraints.maxWidth, MediaQuery.sizeOf(context).height / 2);

Size? logicalSize;
var deviceSize = const Size(-1, -1);
var deviceSize = Size(-1, maxSize.height / devicePixelRatio);

if (parameter.width != null && parameter.height != null) {
final devicePixelRatio = MediaQuery.of(context).devicePixelRatio;

deviceSize = Size(
_parseDimension(parameter.width!).toDouble(),
_parseDimension(parameter.height!).toDouble(),
Expand Down Expand Up @@ -66,7 +66,8 @@ class TalkRichObjectFilePreview extends StatelessWidget {
(b) => b
..fileId = int.parse(parameter.id)
..x = deviceSize.width.toInt()
..y = deviceSize.height.toInt(),
..y = deviceSize.height.toInt()
..a = true,
),
),
);
Expand Down