@nativescript-community/text 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nativescript-community/text",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "Expands the capabilities of NativeScript's text property.",
5
5
  "main": "./index",
6
6
  "sideEffects": false,
@@ -30,5 +30,5 @@
30
30
  },
31
31
  "license": "Apache-2.0",
32
32
  "readmeFilename": "README.md",
33
- "gitHead": "f891d0cb217c4e09a141223c5e98905fe13a1b3f"
33
+ "gitHead": "f97a378c39c8a4d113a0a277e2dad6a33bf13929"
34
34
  }
@@ -7,7 +7,7 @@ import CoreGraphics
7
7
  class NSTextUtils: NSObject {
8
8
  class func setTextDecorationAndTransformOn(view:UIView!, text:String!, textDecoration:String!, letterSpacing:CGFloat, lineHeight:CGFloat, color:UIColor!) {
9
9
  let attrDict:NSMutableDictionary! = NSMutableDictionary()
10
- let paragraphStyle:NSMutableParagraphStyle! = nil
10
+ var paragraphStyle:NSMutableParagraphStyle! = nil
11
11
  let isTextType:Bool = (view is UITextField) || (view is UITextView) || (view is UILabel) || (view is UIButton)
12
12
  let isTextView:Bool = (view is UITextView)
13
13
 
@@ -23,7 +23,7 @@ class NSTextUtils: NSObject {
23
23
  let kern:NSNumber! = NSNumber.init(value: letterSpacing * (view as! UILabel).font.pointSize)
24
24
  attrDict[NSAttributedString.Key.kern] = kern
25
25
  }
26
- let fLineHeight = lineHeight
26
+ var fLineHeight = lineHeight
27
27
  if fLineHeight >= 0 {
28
28
  if fLineHeight == 0 {
29
29
  fLineHeight = 0.00001
@@ -89,7 +89,7 @@ class NSTextUtils: NSObject {
89
89
  }
90
90
  }
91
91
  class func computeBaseLineOffset(align:String!, fontAscent:Float, fontDescent:Float, fontBottom:Float, fontTop:Float, fontSize:Float, maxFontSize:Float) -> Float {
92
- let result:Float = 0
92
+ var result:Float = 0
93
93
  if (align == "top") {
94
94
  result = -maxFontSize - fontBottom - fontTop
95
95
  } else if (align == "bottom") {
@@ -162,7 +162,7 @@ class NSTextUtils: NSObject {
162
162
  if (letterSpacing != nil) && letterSpacing.floatValue != 0 {
163
163
  attrText.addAttribute(NSAttributedString.Key.kern, value:letterSpacing.floatValue * fontSize.floatValue, range:fullRange)
164
164
  }
165
- let paragraphStyle:NSMutableParagraphStyle! = nil
165
+ var paragraphStyle:NSMutableParagraphStyle! = nil
166
166
  let textAlignment:NSNumber! = data.object(forKey:"textAlignment") as? NSNumber
167
167
  let createParagraphStyle:()->Void = {
168
168
  if (paragraphStyle == nil) {
@@ -186,7 +186,7 @@ class NSTextUtils: NSObject {
186
186
  let lineHeight:NSNumber! = data.object(forKey:"lineHeight") as? NSNumber
187
187
  if (lineHeight != nil) {
188
188
  createParagraphStyle()
189
- let fLineHeight:Float = lineHeight.floatValue
189
+ var fLineHeight:Float = lineHeight.floatValue
190
190
  if fLineHeight == 0.0 {
191
191
  fLineHeight = 0.00001
192
192
  }
@@ -264,7 +264,7 @@ class NSTextUtils: NSObject {
264
264
  paragraphStyle.alignment = NSTextAlignment.left
265
265
  }
266
266
  if (lineHeight != nil) {
267
- let fLineHeight:CGFloat = CGFloat(lineHeight.floatValue)
267
+ var fLineHeight:CGFloat = CGFloat(lineHeight.floatValue)
268
268
  if fLineHeight == 0.0 {
269
269
  fLineHeight = 0.00001
270
270
  }