Browse Source

Merge branch 'master' into shared-context

shared-context
Richie Hindle 3 years ago
parent
commit
ccaaf90c80
2 changed files with 16 additions and 0 deletions
  1. +14
    -0
      src/nanovg.c
  2. +2
    -0
      src/nanovg.h

+ 14
- 0
src/nanovg.c View File

@@ -736,6 +736,20 @@ NVGcolor nvgGetGlobalTint(NVGcontext* ctx)
return state->tint;
}

void nvgAlpha(NVGcontext* ctx, float alpha)
{
NVGstate* state = nvg__getState(ctx);
state->tint.a *= alpha;
}

void nvgTint(NVGcontext* ctx, NVGcolor tint)
{
NVGstate* state = nvg__getState(ctx);
int i;
for (i = 0; i < 4; i++)
state->tint.rgba[i] *= tint.rgba[i];
}

void nvgTransform(NVGcontext* ctx, float a, float b, float c, float d, float e, float f)
{
NVGstate* state = nvg__getState(ctx);


+ 2
- 0
src/nanovg.h View File

@@ -273,6 +273,8 @@ void nvgLineJoin(NVGcontext* ctx, int join);
void nvgGlobalAlpha(NVGcontext* ctx, float alpha);
void nvgGlobalTint(NVGcontext* ctx, NVGcolor tint);
NVGcolor nvgGetGlobalTint(NVGcontext* ctx);
void nvgAlpha(NVGcontext* ctx, float alpha);
void nvgTint(NVGcontext* ctx, NVGcolor tint);

//
// Transforms


Loading…
Cancel
Save