diff --git a/.idea/androidTestResultsUserPreferences.xml b/.idea/androidTestResultsUserPreferences.xml index 1ee7502..9773c22 100644 --- a/.idea/androidTestResultsUserPreferences.xml +++ b/.idea/androidTestResultsUserPreferences.xml @@ -37,6 +37,7 @@ <map> <entry key="Duration" value="90" /> <entry key="Pixel_5_API_29" value="120" /> + <entry key="Pixel_5_API_33" value="120" /> <entry key="Tests" value="360" /> </map> </option> @@ -49,6 +50,7 @@ <option name="preferredColumnWidths"> <map> <entry key="Duration" value="90" /> + <entry key="Pixel_5_API_33" value="120" /> <entry key="Pixel_5_API_34" value="120" /> <entry key="Tests" value="360" /> </map> diff --git a/README.md b/README.md index 52d6f07..b65a52c 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ repositories { } dependencies { - implementation 'dev.romainguy:pathway:0.11.0' + implementation 'dev.romainguy:pathway:0.12.0' } ``` diff --git a/gradle.properties b/gradle.properties index 97b7ac6..fa49c1f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ GROUP=dev.romainguy -VERSION_NAME=0.11.0 +VERSION_NAME=0.12.0 SONATYPE_HOST=S01 RELEASE_SIGNING_ENABLED=true diff --git a/pathway/src/androidTest/java/dev/romainguy/graphics/path/TestUtilities.kt b/pathway/src/androidTest/java/dev/romainguy/graphics/path/TestUtilities.kt index 9fdd23e..4f5e73c 100644 --- a/pathway/src/androidTest/java/dev/romainguy/graphics/path/TestUtilities.kt +++ b/pathway/src/androidTest/java/dev/romainguy/graphics/path/TestUtilities.kt @@ -59,6 +59,16 @@ fun compareBitmaps(b1: Bitmap, b2: Bitmap, error: Int = 1) { } } +fun valueCountForType(type: PathSegment.Type) = when(type) { + PathSegment.Type.Move -> 2 + PathSegment.Type.Line -> 4 + PathSegment.Type.Quadratic -> 6 + PathSegment.Type.Conic -> 8 + PathSegment.Type.Cubic -> 8 + PathSegment.Type.Close -> 0 + PathSegment.Type.Done -> 0 +} + fun assertPathEquals( expected: Path, actual: Path, @@ -73,7 +83,12 @@ fun assertPathEquals( while (iterator1.hasNext() && iterator2.hasNext()) { val type1 = iterator1.next(points1) val type2 = iterator2.next(points2) + + points1.fill(0.0f, valueCountForType(type1)) + points2.fill(0.0f, valueCountForType(type2)) + assertEquals(type1, type2) + Assert.assertArrayEquals(points1, points2, 1e-10f) } } diff --git a/pathway/src/main/cpp/pathway.cpp b/pathway/src/main/cpp/pathway.cpp index ec1a127..9b8c77c 100644 --- a/pathway/src/main/cpp/pathway.cpp +++ b/pathway/src/main/cpp/pathway.cpp @@ -66,7 +66,7 @@ static jlong createPathIterator(JNIEnv* env, jclass, PathIterator::VerbDirection direction; const uint32_t apiLevel = api_level(); - if (apiLevel >= 33) { + if (apiLevel >= 34) { auto* ref = reinterpret_cast<PathRef34*>(path->pathRef); points = ref->points; verbs = ref->verbs;