File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
tehreer-android/src/main/java/com/mta/tehreer/sfnt Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1717package com .mta .tehreer .sfnt ;
1818
1919import androidx .annotation .NonNull ;
20+ import androidx .annotation .Nullable ;
2021
2122import com .mta .tehreer .Disposable ;
2223import com .mta .tehreer .collections .FloatList ;
@@ -238,10 +239,15 @@ public int getGlyphCount() {
238239 * @param caretStops An array for caret stops of the code units represented by this object.
239240 * @return A list of caret edges.
240241 */
241- public @ NonNull FloatList getCaretEdges (boolean [] caretStops ) {
242+ public @ NonNull FloatList getCaretEdges (@ Nullable boolean [] caretStops ) {
242243 int charCount = getCharCount ();
243- float [] caretEdges = new float [charCount + 1 ];
244+ if (caretStops != null ) {
245+ if (caretStops .length < charCount ) {
246+ throw new IllegalArgumentException ("The length of caret stops array must be at least the represented character count" );
247+ }
248+ }
244249
250+ float [] caretEdges = new float [charCount + 1 ];
245251 nGetCaretEdges (nativeResult , caretStops , caretEdges );
246252
247253 return FloatList .of (caretEdges );
You can’t perform that action at this time.
0 commit comments