updated frame
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
24bad2c371
commit
1d3431da2c
@ -46,7 +46,9 @@ public struct ImageLabelAttribute: AttachmentLabelAttributeModel {
|
||||
private func imageAttachment(image: UIImage) -> NSTextAttachment {
|
||||
let attachment = NSTextAttachment()
|
||||
attachment.image = tintColor != nil ? image.withTintColor(tintColor!) : image
|
||||
attachment.bounds = frame ?? .init(x: 0, y: 0, width: image.size.width, height: image.size.height)
|
||||
if let frame {
|
||||
attachment.bounds = frame
|
||||
}
|
||||
return attachment
|
||||
}
|
||||
|
||||
|
||||
@ -20,9 +20,13 @@ public struct ToolTipLabelAttribute: ActionLabelAttributeModel {
|
||||
public var size: Tooltip.Size
|
||||
|
||||
public func setAttribute(on attributedString: NSMutableAttributedString) {
|
||||
let size = size.dimensions.height
|
||||
var yPos = (lineHeight / 2) - size
|
||||
if yPos < 0 { yPos = 0 }
|
||||
var size = size.dimensions.height
|
||||
var yPos = (lineHeight - size) / 2
|
||||
print("tooltip yPos: \(yPos)")
|
||||
if yPos < 0 {
|
||||
yPos = 0
|
||||
size = lineHeight
|
||||
}
|
||||
let image = ImageLabelAttribute(location: location,
|
||||
length: length,
|
||||
imageName: "info",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user