Browse Source

Merge pull request #93 from jacereda/master

Relax stroke width limit
shared-context
Mikko Mononen 11 years ago
parent
commit
adb7528ed3
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/nanovg.c

+ 2
- 2
src/nanovg.c View File

@@ -2000,13 +2000,13 @@ void nvgStroke(struct NVGcontext* ctx)
{
struct NVGstate* state = nvg__getState(ctx);
float scale = nvg__getAverageScale(state->xform);
float strokeWidth = nvg__clampf(state->strokeWidth * scale, 0.0f, 20.0f);
float strokeWidth = nvg__clampf(state->strokeWidth * scale, 0.0f, 200.0f);
struct NVGpaint strokePaint = state->stroke;
const struct NVGpath* path;
int i;

if (strokeWidth < ctx->fringeWidth) {
// If the stroke width is less than pixel size, use alpha to emulate coverate.
// If the stroke width is less than pixel size, use alpha to emulate coverage.
// Since coverage is area, scale by alpha*alpha.
float alpha = nvg__clampf(strokeWidth / ctx->fringeWidth, 0.0f, 1.0f);
strokePaint.innerColor.a *= alpha*alpha;


Loading…
Cancel
Save