filling the vertex buffer fixed

This commit is contained in:
Uwe Rathmann 2022-09-26 17:50:07 +02:00
parent 60efe3649b
commit 12e462e657

View File

@ -27,7 +27,7 @@ static void qskUpdateGeometry( const QPainterPath& path, QSGGeometry& geometry )
geometry.allocate( ts.vertices.size(), ts.indices.size() );
auto vertexData = geometry.vertexDataAsPoint2D();
auto vertexData = reinterpret_cast< float* >( geometry.vertexData() );
const auto points = ts.vertices.constData();
/*
@ -37,7 +37,7 @@ static void qskUpdateGeometry( const QPainterPath& path, QSGGeometry& geometry )
*/
for ( int i = 0; i < ts.vertices.count(); ++i )
vertexData[i].set( points[i * 2], points[i * 2 + 1] );
vertexData[i] = points[i];
memcpy( geometry.indexData(), ts.indices.data(),
ts.indices.size() * sizeof( quint16 ) );