summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/gl/context.cpp')
-rw-r--r--src/mbgl/gl/context.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp
index b12c77c1a1..c4485ad0fd 100644
--- a/src/mbgl/gl/context.cpp
+++ b/src/mbgl/gl/context.cpp
@@ -533,9 +533,9 @@ void Context::draw(const Drawable& drawable) {
if (drawable.indexBuffer) {
MBGL_CHECK_ERROR(glDrawElements(
static_cast<GLenum>(primitiveType),
- static_cast<GLsizei>(drawable.primitiveSize / sizeof(uint16_t) * segment.primitiveLength),
+ static_cast<GLsizei>(segment.indexLength),
GL_UNSIGNED_SHORT,
- reinterpret_cast<GLvoid*>(drawable.primitiveSize * segment.primitiveOffset)));
+ reinterpret_cast<GLvoid*>(sizeof(uint16_t) * segment.indexOffset)));
} else {
MBGL_CHECK_ERROR(glDrawArrays(
static_cast<GLenum>(primitiveType),