Update nanovg.c
This commit is contained in:
parent
99bd7b358e
commit
731cb55221
29
src/nanovg.c
29
src/nanovg.c
@ -1661,20 +1661,21 @@ void nvgRoundedRect(struct NVGcontext* ctx, float x, float y, float w, float h,
|
||||
nvgRect(ctx, x,y,w,h);
|
||||
return;
|
||||
}
|
||||
|
||||
float vals[] = {
|
||||
NVG_MOVETO, x+r, y,
|
||||
NVG_LINETO, x+w-r, y,
|
||||
NVG_BEZIERTO, x+w-r*(1-NVG_KAPPA90), y, x+w, y+r*(1-NVG_KAPPA90), x+w, y+r,
|
||||
NVG_LINETO, x+w, y+h-r,
|
||||
NVG_BEZIERTO, x+w, y+h-r*(1-NVG_KAPPA90), x+w-r*(1-NVG_KAPPA90), y+h, x+w-r, y+h,
|
||||
NVG_LINETO, x+r, y+h,
|
||||
NVG_BEZIERTO, x+r*(1-NVG_KAPPA90), y+h, x, y+h-r*(1-NVG_KAPPA90), x, y+h-r,
|
||||
NVG_LINETO, x, y+r,
|
||||
NVG_BEZIERTO, x, y+r*(1-NVG_KAPPA90), x+r*(1-NVG_KAPPA90), y, x+r, y,
|
||||
NVG_CLOSE
|
||||
};
|
||||
nvg__appendCommands(ctx, vals, NVG_COUNTOF(vals));
|
||||
else {
|
||||
float vals[] = {
|
||||
NVG_MOVETO, x+r, y,
|
||||
NVG_LINETO, x+w-r, y,
|
||||
NVG_BEZIERTO, x+w-r*(1-NVG_KAPPA90), y, x+w, y+r*(1-NVG_KAPPA90), x+w, y+r,
|
||||
NVG_LINETO, x+w, y+h-r,
|
||||
NVG_BEZIERTO, x+w, y+h-r*(1-NVG_KAPPA90), x+w-r*(1-NVG_KAPPA90), y+h, x+w-r, y+h,
|
||||
NVG_LINETO, x+r, y+h,
|
||||
NVG_BEZIERTO, x+r*(1-NVG_KAPPA90), y+h, x, y+h-r*(1-NVG_KAPPA90), x, y+h-r,
|
||||
NVG_LINETO, x, y+r,
|
||||
NVG_BEZIERTO, x, y+r*(1-NVG_KAPPA90), x+r*(1-NVG_KAPPA90), y, x+r, y,
|
||||
NVG_CLOSE
|
||||
};
|
||||
nvg__appendCommands(ctx, vals, NVG_COUNTOF(vals));
|
||||
}
|
||||
}
|
||||
|
||||
void nvgEllipse(struct NVGcontext* ctx, float cx, float cy, float rx, float ry)
|
||||
|
Loading…
x
Reference in New Issue
Block a user