Merge pull request #674 from pangeachat/toolbar-updates

if, by shifting up a message to make footer space, a header overflow …
pull/1384/head
ggurdin 1 year ago committed by GitHub
commit 11fbb3514a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -74,13 +74,20 @@ class MessageSelectionOverlayState extends State<MessageSelectionOverlay>
double scrollOffset = 0; double scrollOffset = 0;
double animationEndOffset = 0; double animationEndOffset = 0;
if (hasHeaderOverflow) {
final midpoint = (headerBottomOffset + footerBottomOffset) / 2; final midpoint = (headerBottomOffset + footerBottomOffset) / 2;
if (hasHeaderOverflow) {
animationEndOffset = midpoint - messageSize!.height; animationEndOffset = midpoint - messageSize!.height;
scrollOffset = animationEndOffset - currentBottomOffset; scrollOffset = animationEndOffset - currentBottomOffset;
} else if (hasFooterOverflow) { } else if (hasFooterOverflow) {
scrollOffset = footerHeight - currentBottomOffset; scrollOffset = footerHeight - currentBottomOffset;
animationEndOffset = currentBottomOffset + scrollOffset; animationEndOffset = footerHeight;
final bottomOffsetDifference = footerHeight - currentBottomOffset;
final newTopOffset = messageOffset!.dy - bottomOffsetDifference;
if (newTopOffset < (headerHeight + AppConfig.toolbarMaxHeight)) {
animationEndOffset = midpoint - messageSize!.height;
scrollOffset = animationEndOffset - currentBottomOffset;
}
} }
_overlayPositionAnimation = Tween<double>( _overlayPositionAnimation = Tween<double>(

Loading…
Cancel
Save