summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 61f0bc9)
raw | patch | inline | side by side (parent: 61f0bc9)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Tue, 8 Jul 2008 18:05:08 +0000 (18:05 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Tue, 8 Jul 2008 18:05:08 +0000 (18:05 +0000) |
src/dropper-context.cpp | patch | blob | history | |
src/dyna-draw-context.cpp | patch | blob | history | |
src/tweak-context.cpp | patch | blob | history |
index 81814fc01cd1e154e3219768da72c1562699aade..0be132340f9bfcf6c50f7edf0ee50f3298b4950d 100644 (file)
--- a/src/dropper-context.cpp
+++ b/src/dropper-context.cpp
((SPEventContextClass *) parent_class)->setup(ec);
}
- SPCurve *c = SPCurve::new_from_foreign_bpath(spdc_circle);
+ /* TODO: have a look at sp_dyna_draw_context_setup where the same is done.. generalize? at least make it an arcto! */
+ SPCurve *c = new SPCurve();
+ const double C1 = 0.552;
+ c->moveto(-1,0);
+ c->curveto(-1, C1, -C1, 1, 0, 1 );
+ c->curveto(C1, 1, 1, C1, 1, 0 );
+ c->curveto(1, -C1, C1, -1, 0, -1 );
+ c->curveto(-C1, -1, -1, -C1, -1, 0 );
+ c->closepath();
dc->area = sp_canvas_bpath_new(sp_desktop_controls(ec->desktop), c);
c->unref();
sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(dc->area), 0x00000000,(SPWindRule)0);
index 8db9cb2e174e3103f89051192bfddd002d021d43..4e7c855caa692918656455759a5711d758fee474 100644 (file)
#define DYNA_MIN_WIDTH 1.0e-6
-
-// FIXME: move it to some shared file to be reused by both calligraphy and dropper
-#define C1 0.552
-static NArtBpath const hatch_area_circle[] = {
- { NR_MOVETO, 0, 0, 0, 0, -1, 0 },
- { NR_CURVETO, -1, C1, -C1, 1, 0, 1 },
- { NR_CURVETO, C1, 1, 1, C1, 1, 0 },
- { NR_CURVETO, 1, -C1, C1, -1, 0, -1 },
- { NR_CURVETO, -C1, -1, -1, -C1, -1, 0 },
- { NR_END, 0, 0, 0, 0, 0, 0 }
-};
-#undef C1
-
-
static void sp_dyna_draw_context_class_init(SPDynaDrawContextClass *klass);
static void sp_dyna_draw_context_init(SPDynaDrawContext *ddc);
static void sp_dyna_draw_context_dispose(GObject *object);
g_signal_connect(G_OBJECT(ddc->currentshape), "event", G_CALLBACK(sp_desktop_root_handler), ec->desktop);
{
- SPCurve *c = SPCurve::new_from_foreign_bpath(hatch_area_circle);
+ /* TODO: this can be done either with an arcto, and should maybe also be put in a general file (other tools use this as well) */
+ SPCurve *c = new SPCurve();
+ const double C1 = 0.552;
+ c->moveto(-1,0);
+ c->curveto(-1, C1, -C1, 1, 0, 1 );
+ c->curveto(C1, 1, 1, C1, 1, 0 );
+ c->curveto(1, -C1, C1, -1, 0, -1 );
+ c->curveto(-C1, -1, -1, -C1, -1, 0 );
+ c->closepath();
ddc->hatch_area = sp_canvas_bpath_new(sp_desktop_controls(ec->desktop), c);
c->unref();
sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(ddc->hatch_area), 0x00000000,(SPWindRule)0);
diff --git a/src/tweak-context.cpp b/src/tweak-context.cpp
index 923a219bc4952f7bf72a4c6f5f423e5fa6a9689b..5e572c39e25b7c9e05f0ddde6dddb2c882d60432 100644 (file)
--- a/src/tweak-context.cpp
+++ b/src/tweak-context.cpp
#define DYNA_MIN_WIDTH 1.0e-6
-// FIXME: move it to some shared file to be reused by both calligraphy and dropper
-#define C1 0.552
-static NArtBpath const hatch_area_circle[] = {
- { NR_MOVETO, 0, 0, 0, 0, -1, 0 },
- { NR_CURVETO, -1, C1, -C1, 1, 0, 1 },
- { NR_CURVETO, C1, 1, 1, C1, 1, 0 },
- { NR_CURVETO, 1, -C1, C1, -1, 0, -1 },
- { NR_CURVETO, -C1, -1, -1, -C1, -1, 0 },
- { NR_END, 0, 0, 0, 0, 0, 0 }
-};
-#undef C1
-
-
static void sp_tweak_context_class_init(SPTweakContextClass *klass);
static void sp_tweak_context_init(SPTweakContext *ddc);
static void sp_tweak_context_dispose(GObject *object);
((SPEventContextClass *) parent_class)->setup(ec);
{
- SPCurve *c = SPCurve::new_from_foreign_bpath(hatch_area_circle);
+ /* TODO: have a look at sp_dyna_draw_context_setup where the same is done.. generalize? at least make it an arcto! */
+ SPCurve *c = new SPCurve();
+ const double C1 = 0.552;
+ c->moveto(-1,0);
+ c->curveto(-1, C1, -C1, 1, 0, 1 );
+ c->curveto(C1, 1, 1, C1, 1, 0 );
+ c->curveto(1, -C1, C1, -1, 0, -1 );
+ c->curveto(-C1, -1, -1, -C1, -1, 0 );
+ c->closepath();
tc->dilate_area = sp_canvas_bpath_new(sp_desktop_controls(ec->desktop), c);
c->unref();
sp_canvas_bpath_set_fill(SP_CANVAS_BPATH(tc->dilate_area), 0x00000000,(SPWindRule)0);