Browse Source

use -1 as the 'no scissor' value, rather than 0, so that 0 width still scissors

shared-context
Scott Graham 11 years ago
parent
commit
aefc9a6104
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      src/nanovg.c
  2. +1
    -1
      src/nanovg_gl.h

+ 2
- 2
src/nanovg.c View File

@@ -828,8 +828,8 @@ void nvgResetScissor(struct NVGcontext* ctx)
{
struct NVGstate* state = nvg__getState(ctx);
memset(state->scissor.xform, 0, sizeof(state->scissor.xform));
state->scissor.extent[0] = 0;
state->scissor.extent[1] = 0;
state->scissor.extent[0] = -1.f;
state->scissor.extent[1] = -1.f;
}

static int nvg__ptEquals(float x1, float y1, float x2, float y2, float tol)


+ 1
- 1
src/nanovg_gl.h View File

@@ -750,7 +750,7 @@ static int glnvg__convertPaint(struct GLNVGcontext* gl, struct GLNVGfragUniforms
frag->innerCol = glnvg__premulColor(paint->innerColor);
frag->outerCol = glnvg__premulColor(paint->outerColor);

if (scissor->extent[0] < 0.5f || scissor->extent[1] < 0.5f) {
if (scissor->extent[0] < -0.5f || scissor->extent[1] < -0.5f) {
memset(frag->scissorMat, 0, sizeof(frag->scissorMat));
frag->scissorExt[0] = 1.0f;
frag->scissorExt[1] = 1.0f;


Loading…
Cancel
Save