@@ -272,10 +272,14 @@ public final class MessageView: UIView, MessageTextViewListener {
272
272
let textViewHeight = self . textViewHeight
273
273
let textViewMaxY = textViewY + textViewHeight
274
274
275
+ // adjust for font descender so button aligns with the text baseline
276
+ let descenderAdjustment = floor ( textView. font? . descender ?? 0 )
277
+ let buttonYStarter = textViewMaxY - textViewInset. bottom - descenderAdjustment
278
+
275
279
// adjust by bottom offset so content is flush w/ text view
276
280
let leftButtonFrame = CGRect (
277
281
x: safeBounds. minX + leftButtonInset,
278
- y: textViewMaxY - leftButtonSize. height + leftButton. bottomHeightOffset - textViewInset . bottom ,
282
+ y: buttonYStarter - leftButtonSize. height + leftButton. bottomHeightOffset,
279
283
width: leftButtonSize. width,
280
284
height: leftButtonSize. height
281
285
)
@@ -293,7 +297,7 @@ public final class MessageView: UIView, MessageTextViewListener {
293
297
// adjust by bottom offset so content is flush w/ text view
294
298
let rightButtonFrame = CGRect (
295
299
x: textViewFrame. maxX,
296
- y: textViewMaxY - rightButtonSize. height + rightButton. bottomHeightOffset - textViewInset . bottom ,
300
+ y: buttonYStarter - rightButtonSize. height + rightButton. bottomHeightOffset,
297
301
width: rightButtonSize. width,
298
302
height: rightButtonSize. height
299
303
)
0 commit comments