diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-05-05 19:00:20 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-05-05 19:00:20 +0000 |
| commit | d955f60393f4f85b0269346f37b4481a1c70205a (patch) | |
| tree | 2dd9a11fe737c4a43c8aa88451acd3c8f766fff2 /src/sp-rect.cpp | |
| parent | Cmake: Moved helper macros to their own file and removed *-test.h from inksca... (diff) | |
| download | inkscape-d955f60393f4f85b0269346f37b4481a1c70205a.tar.gz inkscape-d955f60393f4f85b0269346f37b4481a1c70205a.zip | |
struct SPCurve => class SPCurve
change all sp_curve_methods functions to SPCurve::methods.
(bzr r5609)
Diffstat (limited to 'src/sp-rect.cpp')
| -rw-r--r-- | src/sp-rect.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp index 2e9befa32..b02f52f1e 100644 --- a/src/sp-rect.cpp +++ b/src/sp-rect.cpp @@ -239,7 +239,7 @@ sp_rect_set_shape(SPShape *shape) return; } - SPCurve *c = sp_curve_new(); + SPCurve *c = new SPCurve(); double const x = rect->x.computed; double const y = rect->y.computed; @@ -268,26 +268,26 @@ sp_rect_set_shape(SPShape *shape) * arc fairly well. */ if ((rx > 1e-18) && (ry > 1e-18)) { - sp_curve_moveto(c, x + rx, y); - if (rx < w2) sp_curve_lineto(c, x + w - rx, y); - sp_curve_curveto(c, x + w - rx * (1 - C1), y, x + w, y + ry * (1 - C1), x + w, y + ry); - if (ry < h2) sp_curve_lineto(c, x + w, y + h - ry); - sp_curve_curveto(c, x + w, y + h - ry * (1 - C1), x + w - rx * (1 - C1), y + h, x + w - rx, y + h); - if (rx < w2) sp_curve_lineto(c, x + rx, y + h); - sp_curve_curveto(c, x + rx * (1 - C1), y + h, x, y + h - ry * (1 - C1), x, y + h - ry); - if (ry < h2) sp_curve_lineto(c, x, y + ry); - sp_curve_curveto(c, x, y + ry * (1 - C1), x + rx * (1 - C1), y, x + rx, y); + c->moveto(x + rx, y); + if (rx < w2) c->lineto(x + w - rx, y); + c->curveto(x + w - rx * (1 - C1), y, x + w, y + ry * (1 - C1), x + w, y + ry); + if (ry < h2) c->lineto(x + w, y + h - ry); + c->curveto(x + w, y + h - ry * (1 - C1), x + w - rx * (1 - C1), y + h, x + w - rx, y + h); + if (rx < w2) c->lineto(x + rx, y + h); + c->curveto(x + rx * (1 - C1), y + h, x, y + h - ry * (1 - C1), x, y + h - ry); + if (ry < h2) c->lineto(x, y + ry); + c->curveto(x, y + ry * (1 - C1), x + rx * (1 - C1), y, x + rx, y); } else { - sp_curve_moveto(c, x + 0.0, y + 0.0); - sp_curve_lineto(c, x + w, y + 0.0); - sp_curve_lineto(c, x + w, y + h); - sp_curve_lineto(c, x + 0.0, y + h); - sp_curve_lineto(c, x + 0.0, y + 0.0); + c->moveto(x + 0.0, y + 0.0); + c->lineto(x + w, y + 0.0); + c->lineto(x + w, y + h); + c->lineto(x + 0.0, y + h); + c->lineto(x + 0.0, y + 0.0); } - sp_curve_closepath_current(c); + c->closepath_current(); sp_shape_set_curve_insync(SP_SHAPE(rect), c, TRUE); - sp_curve_unref(c); + c->unref(); } /* fixme: Think (Lauris) */ |
