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 {
|
private func imageAttachment(image: UIImage) -> NSTextAttachment {
|
||||||
let attachment = NSTextAttachment()
|
let attachment = NSTextAttachment()
|
||||||
attachment.image = tintColor != nil ? image.withTintColor(tintColor!) : image
|
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
|
return attachment
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -20,9 +20,13 @@ public struct ToolTipLabelAttribute: ActionLabelAttributeModel {
|
|||||||
public var size: Tooltip.Size
|
public var size: Tooltip.Size
|
||||||
|
|
||||||
public func setAttribute(on attributedString: NSMutableAttributedString) {
|
public func setAttribute(on attributedString: NSMutableAttributedString) {
|
||||||
let size = size.dimensions.height
|
var size = size.dimensions.height
|
||||||
var yPos = (lineHeight / 2) - size
|
var yPos = (lineHeight - size) / 2
|
||||||
if yPos < 0 { yPos = 0 }
|
print("tooltip yPos: \(yPos)")
|
||||||
|
if yPos < 0 {
|
||||||
|
yPos = 0
|
||||||
|
size = lineHeight
|
||||||
|
}
|
||||||
let image = ImageLabelAttribute(location: location,
|
let image = ImageLabelAttribute(location: location,
|
||||||
length: length,
|
length: length,
|
||||||
imageName: "info",
|
imageName: "info",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user