示例#1
0
文件: VsGFX.hpp 项目: solpie/linAnil
void vsDropShadow(NVGcontext *ctx, float x, float y, float w, float h,
                  float r, float feather, float alpha) {

    nvgBeginPath(ctx);
    y += feather;
    h -= feather;

    nvgMoveTo(ctx, x - feather, y - feather);
    nvgLineTo(ctx, x, y - feather);
    nvgLineTo(ctx, x, y + h - feather);
    nvgArcTo(ctx, x, y + h, x + r, y + h, r);
    nvgArcTo(ctx, x + w, y + h, x + w, y + h - r, r);
    nvgLineTo(ctx, x + w, y - feather);
    nvgLineTo(ctx, x + w + feather, y - feather);
    nvgLineTo(ctx, x + w + feather, y + h + feather);
    nvgLineTo(ctx, x - feather, y + h + feather);
    nvgClosePath(ctx);

    nvgFillPaint(ctx, nvgBoxGradient(ctx,
                                     x - feather * 0.5f, y - feather * 0.5f,
                                     w + feather, h + feather,
                                     r + feather * 0.5f,
                                     feather,
                                     nvgRGBAf(0, 0, 0, alpha * alpha),
                                     nvgRGBAf(0, 0, 0, 0)));
    nvgFill(ctx);
}
示例#2
0
文件: NanoVG.cpp 项目: naohisas/KVS
void NanoVG::arcTo( float x1, float y1, float x2, float y2, float radius )
{
    nvgArcTo( m_context(), x1, y1, x2, y2, radius );
}
示例#3
0
void QNanoPainter::arcTo(float c1x, float c1y, float c2x, float c2y, float radius)
{
    _checkAlignPixelsAdjust(&c1x, &c1y, &c2x, &c2y);
    nvgArcTo(nvgCtx(), c1x, c1y, c2x, c2y, radius);
}
示例#4
0
JNIEXPORT void JNICALL Java_firststep_internal_NVG_arcTo
  (JNIEnv *e, jclass c, jlong ctx, jfloat x1, jfloat y1, jfloat x2, jfloat y2, jfloat radius)
{
	nvgArcTo((NVGcontext*)ctx, x1, y1, x2, y2, radius);
}
示例#5
0
void VectorRenderer::arcTo(float cx, float cy, float x, float y, float radius) {
	nvgArcTo(nvg, cx, cy, x, y, radius);
}