mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-05 16:04:38 +00:00
fix an "out of range" error
The half of a char in java has a range of [0, 255], so the array's length should be 256.
This commit is contained in:
@@ -7,7 +7,7 @@ import java.util.ArrayList;
|
|||||||
|
|
||||||
class GlyphPathBag {
|
class GlyphPathBag {
|
||||||
private final ArrayList<Path> paths = new ArrayList<>();
|
private final ArrayList<Path> paths = new ArrayList<>();
|
||||||
private final int[][] data = new int[255][];
|
private final int[][] data = new int[256][];
|
||||||
private final Paint paint;
|
private final Paint paint;
|
||||||
|
|
||||||
GlyphPathBag(Paint paint) {
|
GlyphPathBag(Paint paint) {
|
||||||
@@ -28,7 +28,7 @@ class GlyphPathBag {
|
|||||||
|
|
||||||
int[] bin = data[ch >> 8];
|
int[] bin = data[ch >> 8];
|
||||||
if (bin == null) {
|
if (bin == null) {
|
||||||
bin = data[ch >> 8] = new int[255];
|
bin = data[ch >> 8] = new int[256];
|
||||||
}
|
}
|
||||||
bin[ch & 0xFF] = paths.size();
|
bin[ch & 0xFF] = paths.size();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user