[librsvg/rustification] Use new function rsvg_get_normalized_stroke_width() instead of doing this by hand everywhere
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/rustification] Use new function rsvg_get_normalized_stroke_width() instead of doing this by hand everywhere
- Date: Wed, 9 Nov 2016 01:18:01 +0000 (UTC)
commit da4a2a7cdc38e4c2b473997787f828219a7ea91e
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Nov 8 18:51:30 2016 -0600
Use new function rsvg_get_normalized_stroke_width() instead of doing this by hand everywhere
rsvg-base.c | 8 ++++++++
rsvg-cairo-draw.c | 2 +-
rsvg-marker.c | 2 +-
rsvg-private.h | 2 ++
4 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/rsvg-base.c b/rsvg-base.c
index 1c0e187..24338b5 100644
--- a/rsvg-base.c
+++ b/rsvg-base.c
@@ -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)
{
diff --git a/rsvg-cairo-draw.c b/rsvg-cairo-draw.c
index 89044ac..2425074 100644
--- a/rsvg-cairo-draw.c
+++ b/rsvg-cairo-draw.c
@@ -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);
diff --git a/rsvg-marker.c b/rsvg-marker.c
index b74c8ce..0b5a406 100644
--- a/rsvg-marker.c
+++ b/rsvg-marker.c
@@ -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,
diff --git a/rsvg-private.h b/rsvg-private.h
index 93514b5..797fc08 100644
--- a/rsvg-private.h
+++ b/rsvg-private.h
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]