diff --git a/binding/Binding/SKVertices.cs b/binding/Binding/SKVertices.cs index 2adc79ca324..4a3a467820e 100644 --- a/binding/Binding/SKVertices.cs +++ b/binding/Binding/SKVertices.cs @@ -53,13 +53,13 @@ public static SKVertices CreateCopy (SKVertexMode vmode, int vertexOffset, int v if (colors != null && positions.Length != colors.Length) throw new ArgumentException ("The number of colors must match the number of vertices.", nameof (colors)); - if (vertexOffset >= positions.Length) + if (vertexOffset > positions.Length) throw new ArgumentException ("The vertex offset should be in bounds of vertex array.", nameof (vertexOffset)); if (vertexOffset + vertexCount >= positions.Length) throw new ArgumentException ("The vertex count should be in bounds of vertex array.", nameof (vertexOffset)); - if (indexOffset >= indices.Length) + if (indexOffset > indices.Length) throw new ArgumentException ("The index offset should be in bounds of index array.", nameof (vertexOffset)); if (indexOffset + indexCount >= indices.Length) @@ -69,7 +69,7 @@ public static SKVertices CreateCopy (SKVertexMode vmode, int vertexOffset, int v fixed (SKPoint* t = texs) fixed (SKColor* c = colors) fixed (UInt16* i = indices) { - return GetObject (SkiaApi.sk_vertices_make_copy (vmode, vertexCount, p + vertexOffset, t + vertexOffset, (uint*)c + vertexOffset, indexCount, i + indexOffset)); + 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))); } }