Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing the Font descender as button get push down #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions MessageViewController/MessageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,13 @@ public final class MessageView: UIView, MessageTextViewListener {
let textViewMaxY = textViewY + textViewHeight

// adjust for font descender so button aligns with the text baseline
let descender, pointSize: CGFloat
let pointSize: CGFloat
if let font = textView.font {
descender = floor(font.descender)
pointSize = ceil(font.pointSize)
} else {
descender = 0
pointSize = 0
}
let buttonYStarter = textViewMaxY - textViewInset.bottom - (pointSize - descender)/2
let buttonYStarter = textViewMaxY - textViewInset.bottom - pointSize

// adjust by bottom offset so content is flush w/ text view
let leftButtonFrame = CGRect(
Expand Down