You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
fix Layout.getLineStart() / Layout.getLineEnd()
These methods are supposed to return the String index and not coordinates as accidently assumed when originally implementing it.
This commit is contained in:
@@ -155,13 +155,13 @@ public class Layout {
|
||||
public int getLineStart(int line) {
|
||||
if (line < 0 || line >= getLineCount())
|
||||
throw new ArrayIndexOutOfBoundsException();
|
||||
return native_get_line_left(layout, line);
|
||||
return native_get_line_start(layout, line);
|
||||
}
|
||||
|
||||
public int getLineEnd(int line) {
|
||||
if (line < 0 || line >= getLineCount())
|
||||
throw new ArrayIndexOutOfBoundsException();
|
||||
return native_get_line_right(layout, line);
|
||||
return native_get_line_end(layout, line);
|
||||
}
|
||||
|
||||
public boolean isSpanned() {
|
||||
@@ -238,6 +238,8 @@ public class Layout {
|
||||
protected native int native_get_width(long layout);
|
||||
protected native int native_get_height(long layout);
|
||||
protected native int native_get_line_count(long layout);
|
||||
protected native int native_get_line_start(long layout, int line);
|
||||
protected native int native_get_line_end(long layout, int line);
|
||||
protected native int native_get_line_top(long layout, int line);
|
||||
protected native int native_get_line_bottom(long layout, int line);
|
||||
protected native int native_get_line_left(long layout, int line);
|
||||
|
||||
Reference in New Issue
Block a user