From f02d4670e8132ad9137a0e96814fe3cb08b13410 Mon Sep 17 00:00:00 2001 From: Leandro Borges Ferreira Date: Tue, 7 Feb 2023 20:43:17 +0100 Subject: [PATCH] Adding only negative shift --- .../message_actions_modal.dart | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/stream_chat_flutter/lib/src/message_actions_modal/message_actions_modal.dart b/packages/stream_chat_flutter/lib/src/message_actions_modal/message_actions_modal.dart index 970f4d28..3e1260d5 100644 --- a/packages/stream_chat_flutter/lib/src/message_actions_modal/message_actions_modal.dart +++ b/packages/stream_chat_flutter/lib/src/message_actions_modal/message_actions_modal.dart @@ -106,6 +106,7 @@ class _MessageActionsModalState extends State { .roughMessageSize(widget.messageTheme.messageTextStyle?.fontSize); print('roughSentenceSize $roughSentenceSize'); + print('roughMaxSize $roughMaxSize'); final divFactor = widget.message.attachments.isNotEmpty ? 1 @@ -282,8 +283,10 @@ class _MessageActionsModalState extends State { var result = 0.0; final maxWidth = constraints.maxWidth; + final maxHeight = constraints.maxHeight; - print('INFO - max width: ${maxWidth}. ' + print('INFO - max width: $maxWidth. ' + 'maxHeight: $maxHeight ' 'shiftFactor: $shiftFactor ' 'divFactor: $divFactor'); @@ -294,15 +297,11 @@ class _MessageActionsModalState extends State { offset necessary for the position of reaction look the best way possible. */ - const positiveConstant = 2700; - const negativeConstant = 1700; + const constant = 1500; - if (maxWidth <= 752) { - result = shiftFactor - maxWidth / negativeConstant; - } else { - result = shiftFactor + maxWidth / positiveConstant; - } + result = shiftFactor - maxWidth / constant; } else { + // Small messages, it is simpler to align then. result = 1.2 - divFactor; } } else {