From 08bb1c909d58b33c75f60b471dc2ccf6018eb7f2 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Thu, 16 Nov 2017 15:38:11 -0500 Subject: [PATCH] Show menu controller from centroid of message cells. --- .../ViewControllers/ConversationView/Cells/OWSMessageCell.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m index ff7e0cf5c..64f099314 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m @@ -1200,7 +1200,11 @@ NS_ASSUME_NONNULL_BEGIN // We "eagerly" respond when the long press begins, not when it ends. if (sender.state == UIGestureRecognizerStateBegan) { - CGPoint location = [sender locationInView:self]; + // Show the menu controller from the centroid of the cell, + // not the touch location. This disambiguates which cell + // is the context for the menu if the user presents the menu + // controller from the border between two cells. + CGPoint location = CGPointMake(self.width * 0.5f, self.height * 0.5f); [self showMenuController:location]; } }