react-native-advanced-text 0.1.42 → 0.1.43

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.
@@ -280,7 +280,12 @@ class AdvancedTextView : TextView {
280
280
  if (lineStartOffset >= lineEndOffset) continue
281
281
 
282
282
  val left = currentLayout.getPrimaryHorizontal(lineStartOffset)
283
- val right = currentLayout.getPrimaryHorizontal(lineEndOffset)
283
+ val isLastWordOnLine = lineEndOffset >= currentLayout.getLineEnd(line)
284
+ val right = if (isLastWordOnLine) {
285
+ currentLayout.getLineRight(line)
286
+ } else {
287
+ currentLayout.getPrimaryHorizontal(lineEndOffset)
288
+ }
284
289
  val top = currentLayout.getLineTop(line).toFloat()
285
290
  val bottom = currentLayout.getLineBottom(line).toFloat()
286
291
  val rect = RectF(
@@ -314,7 +319,12 @@ class AdvancedTextView : TextView {
314
319
  if (lineStartOffset >= lineEndOffset) continue
315
320
 
316
321
  val left = currentLayout.getPrimaryHorizontal(lineStartOffset)
317
- val right = currentLayout.getPrimaryHorizontal(lineEndOffset)
322
+ val isLastWordOnLine = lineEndOffset >= currentLayout.getLineEnd(line)
323
+ val right = if (isLastWordOnLine) {
324
+ currentLayout.getLineRight(line)
325
+ } else {
326
+ currentLayout.getPrimaryHorizontal(lineEndOffset)
327
+ }
318
328
  val top = currentLayout.getLineTop(line).toFloat()
319
329
  val bottom = currentLayout.getLineBottom(line).toFloat()
320
330
  val rect = RectF(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-advanced-text",
3
- "version": "0.1.42",
3
+ "version": "0.1.43",
4
4
  "description": " Advanced text component for React Native with custom select options.",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",