@@ -53,13 +53,13 @@ public static SKVertices CreateCopy (SKVertexMode vmode, int vertexOffset, int v
53
53
if ( colors != null && positions . Length != colors . Length )
54
54
throw new ArgumentException ( "The number of colors must match the number of vertices." , nameof ( colors ) ) ;
55
55
56
- if ( vertexOffset >= positions . Length )
56
+ if ( vertexOffset > positions . Length )
57
57
throw new ArgumentException ( "The vertex offset should be in bounds of vertex array." , nameof ( vertexOffset ) ) ;
58
58
59
59
if ( vertexOffset + vertexCount >= positions . Length )
60
60
throw new ArgumentException ( "The vertex count should be in bounds of vertex array." , nameof ( vertexOffset ) ) ;
61
61
62
- if ( indexOffset >= indices . Length )
62
+ if ( indexOffset > indices . Length )
63
63
throw new ArgumentException ( "The index offset should be in bounds of index array." , nameof ( vertexOffset ) ) ;
64
64
65
65
if ( indexOffset + indexCount >= indices . Length )
@@ -69,7 +69,7 @@ public static SKVertices CreateCopy (SKVertexMode vmode, int vertexOffset, int v
69
69
fixed ( SKPoint * t = texs )
70
70
fixed ( SKColor * c = colors )
71
71
fixed ( UInt16 * i = indices ) {
72
- return GetObject ( SkiaApi . sk_vertices_make_copy ( vmode , vertexCount , p + vertexOffset , t + vertexOffset , ( uint * ) c + vertexOffset , indexCount , i + indexOffset ) ) ;
72
+ return GetObject ( SkiaApi . sk_vertices_make_copy ( vmode , vertexCount , p + vertexOffset * sizeof ( SKPoint ) , t + vertexOffset * sizeof ( SKPoint ) , ( uint * ) c + vertexOffset * sizeof ( uint ) , indexCount , i + indexOffset * sizeof ( ushort ) ) ) ;
73
73
}
74
74
}
75
75
0 commit comments