Browse Source

Fixes the bug that gl may fail to draw fringes.

This commit fixes the bug that `glnvg__convexFill()` tried to draw fringes depending on whether `NVG_ANTIALIAS` is set. However, #386 adds `nvgShapeAntiAlias()` for chaning anti-alias state explicitly, and `glnvg__convexFill()` would cause error If the anti-alias state is disabled.
shared-context
Olli Wang 6 years ago
parent
commit
e7154e104e
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/nanovg_gl.h

+ 3
- 3
src/nanovg_gl.h View File

@@ -1049,12 +1049,12 @@ static void glnvg__convexFill(GLNVGcontext* gl, GLNVGcall* call)
glnvg__setUniforms(gl, call->uniformOffset, call->image); glnvg__setUniforms(gl, call->uniformOffset, call->image);
glnvg__checkError(gl, "convex fill"); glnvg__checkError(gl, "convex fill");


for (i = 0; i < npaths; i++)
for (i = 0; i < npaths; i++) {
glDrawArrays(GL_TRIANGLE_FAN, paths[i].fillOffset, paths[i].fillCount); glDrawArrays(GL_TRIANGLE_FAN, paths[i].fillOffset, paths[i].fillCount);
if (gl->flags & NVG_ANTIALIAS) {
// Draw fringes // Draw fringes
for (i = 0; i < npaths; i++)
if (paths[i].strokeCount > 0) {
glDrawArrays(GL_TRIANGLE_STRIP, paths[i].strokeOffset, paths[i].strokeCount); glDrawArrays(GL_TRIANGLE_STRIP, paths[i].strokeOffset, paths[i].strokeCount);
}
} }
} }




Loading…
Cancel
Save