Merge branch 'bugfix/label_textattachment_check' into 'develop'
error check for label attachment See merge request BPHV_MIPS/mvm_core_ui!632
This commit is contained in:
commit
82948957fd
@ -351,9 +351,13 @@ public typealias ActionBlock = () -> ()
|
|||||||
} else {
|
} else {
|
||||||
imageAttachment = Label.getTextAttachmentImage(name: imageName, dimension: fontSize)
|
imageAttachment = Label.getTextAttachmentImage(name: imageName, dimension: fontSize)
|
||||||
}
|
}
|
||||||
let mutableString = NSMutableAttributedString()
|
|
||||||
mutableString.append(NSAttributedString(attachment: imageAttachment))
|
// Confirm that the intended image location is within range.
|
||||||
attributedString.insert(mutableString, at: imageAtt.location)
|
if 0...labelText.count ~= imageAtt.location {
|
||||||
|
let mutableString = NSMutableAttributedString()
|
||||||
|
mutableString.append(NSAttributedString(attachment: imageAttachment))
|
||||||
|
attributedString.insert(mutableString, at: imageAtt.location)
|
||||||
|
}
|
||||||
|
|
||||||
case let fontAtt as LabelAttributeFontModel:
|
case let fontAtt as LabelAttributeFontModel:
|
||||||
if let fontStyle = fontAtt.style {
|
if let fontStyle = fontAtt.style {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user