[librsvg] set proper mode-line and fix indent.



commit 8e37c2a25111ec283779386d13a1a3da791d0f81
Author: Hiroyuki Ikezoe <hiikezoe gnome org>
Date:   Tue Apr 27 19:34:13 2010 +0900

    set proper mode-line and fix indent.

 librsvg-2.0.pc.in |    2 +-
 rsvg-marker.c     |  116 ++++++++++++++++++++++++++++------------------------
 rsvg-marker.h     |    3 +-
 3 files changed, 65 insertions(+), 56 deletions(-)
---
diff --git a/librsvg-2.0.pc.in b/librsvg-2.0.pc.in
index 1585bdc..9e8cdc5 100644
--- a/librsvg-2.0.pc.in
+++ b/librsvg-2.0.pc.in
@@ -11,5 +11,5 @@ Description: library that renders svg files
 Version: @VERSION@
 Requires: glib-2.0 gdk-pixbuf-2.0 cairo
 Requires.private:
-Libs: -L${libdir} -lrsvg-2
+Libs: -L${libdir} -lrsvg-2 -lm
 Cflags: -I${includedir}/librsvg-2
diff --git a/rsvg-marker.c b/rsvg-marker.c
index 658d699..9eb8c64 100644
--- a/rsvg-marker.c
+++ b/rsvg-marker.c
@@ -1,4 +1,5 @@
-/* vim: set sw=4 sts=4: -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim: set sw=4 sts=4 ts=4 expandtab: */
 /*
    rsvg-marker.c: Marker loading and rendering
 
@@ -97,7 +98,7 @@ rsvg_new_marker (void)
 
 void
 rsvg_marker_render (RsvgMarker * self, gdouble x, gdouble y, gdouble orient, gdouble linewidth,
-                    RsvgDrawingCtx * ctx)
+		    RsvgDrawingCtx * ctx)
 {
     gdouble affine[6];
     gdouble taffine[6];
@@ -165,12 +166,12 @@ rsvg_marker_render (RsvgMarker * self, gdouble x, gdouble y, gdouble orient, gdo
     state = rsvg_state_current (ctx);
 
     if (!state->overflow) {
-	if (self->vbox.active)
-	    rsvg_add_clipping_rect (ctx, self->vbox.x, self->vbox.y, self->vbox.w, self->vbox.h);
-	else
-	    rsvg_add_clipping_rect (ctx, 0, 0,
-				    _rsvg_css_normalize_length (&self->width, ctx, 'h'),
-				    _rsvg_css_normalize_length (&self->height, ctx, 'v'));
+        if (self->vbox.active)
+            rsvg_add_clipping_rect (ctx, self->vbox.x, self->vbox.y, self->vbox.w, self->vbox.h);
+        else
+            rsvg_add_clipping_rect (ctx, 0, 0,
+                                    _rsvg_css_normalize_length (&self->width, ctx, 'h'),
+                                    _rsvg_css_normalize_length (&self->height, ctx, 'v'));
     }
 
     for (i = 0; i < self->super.children->len; i++) {
@@ -240,59 +241,66 @@ rsvg_render_markers (const RsvgBpathDef * bpath_def, RsvgDrawingCtx * ctx)
     for (i = 0; i < bpath_def->n_bpath - 1; i++) {
         lastx = x;
         lasty = y;
-	lastcode = code;
+        lastcode = code;
         x = nextx;
         y = nexty;
-	code = nextcode;
+        code = nextcode;
         nextx = bpath_def->bpath[i + 1].x3;
         nexty = bpath_def->bpath[i + 1].y3;
-	nextcode = bpath_def->bpath[i + 1].code;
+        nextcode = bpath_def->bpath[i + 1].code;
 
-        if (nextcode == RSVG_MOVETO 
-	    || nextcode == RSVG_MOVETO_OPEN 
-	    || nextcode == RSVG_END) {
+        if (nextcode == RSVG_MOVETO ||
+            nextcode == RSVG_MOVETO_OPEN ||
+            nextcode == RSVG_END) {
             if (endmarker) {
-		if (code == RSVG_CURVETO) 
-		    rsvg_marker_render (endmarker, x, y, 
-					atan2 (y - bpath_def->bpath[i].y2, 
-					       x - bpath_def->bpath[i].x2), 
-					linewidth, ctx);
-		else
-		    rsvg_marker_render (endmarker, x, y, atan2 (y - lasty, x - lastx), linewidth, ctx);
-	    }
-        } else if (code == RSVG_MOVETO
-                   || code == RSVG_MOVETO_OPEN) {
+                if (code == RSVG_CURVETO) {
+                    rsvg_marker_render (endmarker, x, y,
+                                        atan2 (y - bpath_def->bpath[i].y2,
+                                               x - bpath_def->bpath[i].x2),
+                                        linewidth, ctx);
+                } else {
+                    rsvg_marker_render (endmarker, x, y,
+                                        atan2 (y - lasty, x - lastx),
+                                        linewidth, ctx);
+                }
+            }
+        } else if (code == RSVG_MOVETO ||
+                   code == RSVG_MOVETO_OPEN) {
             if (startmarker) {
-		if (nextcode == RSVG_CURVETO)
-		    rsvg_marker_render (startmarker, x, y, 
-					atan2 (bpath_def->bpath[i + 1].y1 - y, 
-					       bpath_def->bpath[i + 1].x1 - x), linewidth,
-					ctx);
-		else 
-		    rsvg_marker_render (startmarker, x, y, atan2 (nexty - y, nextx - x), linewidth,
-					ctx);
-	    }
-	} else {
-	    if (middlemarker) {
-		double xdifin, ydifin, xdifout, ydifout, intot, outtot, angle;
-
-		if (code == RSVG_CURVETO) {
-		    xdifin = x - bpath_def->bpath[i].x2;
-		    ydifin = y - bpath_def->bpath[i].y2;
-		} else {
-		    xdifin = x - lastx;
-		    ydifin = y - lasty;
-		}
-		if (nextcode == RSVG_CURVETO) {
-		    xdifout = bpath_def->bpath[i+1].x1 - x;
-		    ydifout = bpath_def->bpath[i+1].y1 - y;
-		} else {
-		    xdifout = nextx - x;
-		    ydifout = nexty - y;
-		}
-
-		intot = sqrt (xdifin * xdifin + ydifin * ydifin);
-		outtot = sqrt (xdifout * xdifout + ydifout * ydifout);
+                if (nextcode == RSVG_CURVETO) {
+                    rsvg_marker_render (startmarker, x, y,
+                                        atan2 (bpath_def->bpath[i + 1].y1 - y,
+                                               bpath_def->bpath[i + 1].x1 - x),
+                                        linewidth,
+                                        ctx);
+                } else {
+                    rsvg_marker_render (startmarker, x, y,
+                                        atan2 (nexty - y, nextx - x),
+                                        linewidth,
+					                    ctx);
+                }
+            }
+        } else {
+            if (middlemarker) {
+                double xdifin, ydifin, xdifout, ydifout, intot, outtot, angle;
+
+                if (code == RSVG_CURVETO) {
+                    xdifin = x - bpath_def->bpath[i].x2;
+                    ydifin = y - bpath_def->bpath[i].y2;
+                } else {
+                    xdifin = x - lastx;
+                    ydifin = y - lasty;
+                }
+                if (nextcode == RSVG_CURVETO) {
+                    xdifout = bpath_def->bpath[i+1].x1 - x;
+                    ydifout = bpath_def->bpath[i+1].y1 - y;
+                } else {
+                    xdifout = nextx - x;
+                    ydifout = nexty - y;
+                }
+
+                intot = sqrt (xdifin * xdifin + ydifin * ydifin);
+                outtot = sqrt (xdifout * xdifout + ydifout * ydifout);
 
                 xdifin /= intot;
                 ydifin /= intot;
diff --git a/rsvg-marker.h b/rsvg-marker.h
index 39817ee..1b2d3c3 100644
--- a/rsvg-marker.h
+++ b/rsvg-marker.h
@@ -1,4 +1,5 @@
-/* vim: set sw=4 sts=4: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim: set sw=4 sts=4 ts=4 expandtab: */
 /*
    rsvg-marker.h: Marker loading and rendering
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]