Adding only negative shift

This commit is contained in:
Leandro Borges Ferreira
2023-02-15 19:40:51 +01:00
parent 9fdc864af2
commit f02d4670e8
@@ -106,6 +106,7 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
.roughMessageSize(widget.messageTheme.messageTextStyle?.fontSize); .roughMessageSize(widget.messageTheme.messageTextStyle?.fontSize);
print('roughSentenceSize $roughSentenceSize'); print('roughSentenceSize $roughSentenceSize');
print('roughMaxSize $roughMaxSize');
final divFactor = widget.message.attachments.isNotEmpty final divFactor = widget.message.attachments.isNotEmpty
? 1 ? 1
@@ -282,8 +283,10 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
var result = 0.0; var result = 0.0;
final maxWidth = constraints.maxWidth; final maxWidth = constraints.maxWidth;
final maxHeight = constraints.maxHeight;
print('INFO - max width: ${maxWidth}. ' print('INFO - max width: $maxWidth. '
'maxHeight: $maxHeight '
'shiftFactor: $shiftFactor ' 'shiftFactor: $shiftFactor '
'divFactor: $divFactor'); 'divFactor: $divFactor');
@@ -294,15 +297,11 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
offset necessary for the position of reaction look the best way offset necessary for the position of reaction look the best way
possible. possible.
*/ */
const positiveConstant = 2700; const constant = 1500;
const negativeConstant = 1700;
if (maxWidth <= 752) { result = shiftFactor - maxWidth / constant;
result = shiftFactor - maxWidth / negativeConstant;
} else {
result = shiftFactor + maxWidth / positiveConstant;
}
} else { } else {
// Small messages, it is simpler to align then.
result = 1.2 - divFactor; result = 1.2 - divFactor;
} }
} else { } else {