added edgeInsets
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
838a68348a
commit
0460e10b89
@ -33,10 +33,12 @@ open class Label: UILabel, Handlerable, ViewProtocol, Resettable, UserInfoable {
|
||||
|
||||
open var textStyle: TextStyle = .defaultStyle { didSet { setNeedsUpdate() }}
|
||||
|
||||
open var edgeInsets: UIEdgeInsets { textStyle.edgeInsets }
|
||||
|
||||
open var textPosition: TextPosition = .left { didSet { setNeedsUpdate() }}
|
||||
|
||||
open var userInfo = [String: Primitive]()
|
||||
|
||||
|
||||
override open var text: String? {
|
||||
didSet {
|
||||
attributes = nil
|
||||
@ -114,6 +116,13 @@ open class Label: UILabel, Handlerable, ViewProtocol, Resettable, UserInfoable {
|
||||
shouldUpdateView = true
|
||||
setNeedsUpdate()
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Overrides
|
||||
//--------------------------------------------------
|
||||
open override func drawText(in rect: CGRect) {
|
||||
super.drawText(in: rect.inset(by: edgeInsets))
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Overrides
|
||||
@ -134,7 +143,12 @@ open class Label: UILabel, Handlerable, ViewProtocol, Resettable, UserInfoable {
|
||||
|
||||
//set the attributed text
|
||||
attributedText = mutableText
|
||||
|
||||
//get accessibility
|
||||
updateAccessibilityLabel()
|
||||
|
||||
//force a drawText
|
||||
setNeedsDisplay()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user