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

Add font size argument in text Wireframe builder #1613

Merged
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public class SessionReplayWireframesBuilder {
clip: SRContentClip? = nil,
textColor: CGColor? = nil,
font: UIFont? = nil,
fontSize: CGFloat? = nil,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't entirely like the fact that it's now implicitly either fontSize or font.size. Maybe we could rename to fontSizeOverride ?

fontScalingEnabled: Bool = false,
borderColor: CGColor? = nil,
borderWidth: CGFloat? = nil,
Expand All @@ -116,7 +117,7 @@ public class SessionReplayWireframesBuilder {
)
)

var fontSize = Int64(withNoOverflow: font?.pointSize ?? Fallback.fontSize)
var fontSize = Int64(withNoOverflow: fontSize ?? font?.pointSize ?? Fallback.fontSize)
if text.count > 0, fontScalingEnabled {
// Calculates the approximate font size for available text area √(frameArea / numberOfCharacters)
let area = textFrame.width * textFrame.height
Expand Down