Use new function rsvg_get_normalized_stroke_width() instead of doing this by hand everywhere

parent 8e848163
......@@ -2165,6 +2165,14 @@ rsvg_render_surface (RsvgDrawingCtx * ctx, cairo_surface_t *surface, double x, d
ctx->render->render_surface (ctx, surface, x, y, w, h);
}
double
rsvg_get_normalized_stroke_width (RsvgDrawingCtx *ctx)
{
RsvgState *state = rsvg_current_state (ctx);
return _rsvg_css_normalize_length (&state->stroke_width, ctx, LENGTH_DIR_BOTH);
}
void
rsvg_add_clipping_rect (RsvgDrawingCtx * ctx, double x, double y, double w, double h)
{
......
......@@ -384,7 +384,7 @@ rsvg_cairo_create_pango_context (RsvgDrawingCtx * ctx)
static void
setup_cr_for_stroke (cairo_t *cr, RsvgDrawingCtx *ctx, RsvgState *state)
{
cairo_set_line_width (cr, _rsvg_css_normalize_length (&state->stroke_width, ctx, LENGTH_DIR_BOTH));
cairo_set_line_width (cr, rsvg_get_normalized_stroke_width (ctx));
cairo_set_miter_limit (cr, state->miter_limit);
cairo_set_line_cap (cr, (cairo_line_cap_t) state->cap);
cairo_set_line_join (cr, (cairo_line_join_t) state->join);
......
......@@ -219,7 +219,7 @@ rsvg_render_markers (RsvgDrawingCtx *ctx,
state = rsvg_current_state (ctx);
linewidth = _rsvg_css_normalize_length (&state->stroke_width, ctx, LENGTH_DIR_BOTH);
linewidth = rsvg_get_normalized_stroke_width (ctx);
rsvg_rust_render_markers (ctx,
builder,
......
......@@ -387,6 +387,8 @@ G_GNUC_INTERNAL
void rsvg_render_surface (RsvgDrawingCtx * ctx, cairo_surface_t *surface,
double x, double y, double w, double h);
G_GNUC_INTERNAL
double rsvg_get_normalized_stroke_width (RsvgDrawingCtx *ctx);
G_GNUC_INTERNAL
void rsvg_render_free (RsvgRender * render);
G_GNUC_INTERNAL
void rsvg_add_clipping_rect (RsvgDrawingCtx * ctx, double x, double y, double w, double h);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment