mirror of
https://github.com/memononen/nanovg
synced 2026-09-26 16:19:07 +03:00
Merge pull request #138 from notlion/fix-double-transform
Set commandx/y before the transform
This commit is contained in:
commit
646b0a56cc
1 changed files with 5 additions and 5 deletions
10
src/nanovg.c
10
src/nanovg.c
|
|
@ -970,6 +970,11 @@ static void nvg__appendCommands(NVGcontext* ctx, float* vals, int nvals)
|
|||
ctx->ccommands = ccommands;
|
||||
}
|
||||
|
||||
if ((int)vals[0] != NVG_CLOSE && (int)vals[0] != NVG_WINDING) {
|
||||
ctx->commandx = vals[nvals-2];
|
||||
ctx->commandy = vals[nvals-1];
|
||||
}
|
||||
|
||||
// transform commands
|
||||
i = 0;
|
||||
while (i < nvals) {
|
||||
|
|
@ -1003,11 +1008,6 @@ static void nvg__appendCommands(NVGcontext* ctx, float* vals, int nvals)
|
|||
memcpy(&ctx->commands[ctx->ncommands], vals, nvals*sizeof(float));
|
||||
|
||||
ctx->ncommands += nvals;
|
||||
|
||||
if ((int)vals[0] != NVG_CLOSE && (int)vals[0] != NVG_WINDING) {
|
||||
ctx->commandx = vals[nvals-2];
|
||||
ctx->commandy = vals[nvals-1];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue