diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2014-02-26 21:30:12 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2014-02-26 21:30:12 +0000 |
| commit | 802a1a7537a691e36a6f41d50714905ba809e289 (patch) | |
| tree | 6af369bfc55a66c2b3461dae064f7a62d636f794 /src/ui/tools/pen-tool.cpp | |
| parent | Fixed some/all bugs related to continuing bspline/spiro curves advertaising b... (diff) | |
| parent | Added template functions as a casting-macro replacement. (diff) | |
| download | inkscape-802a1a7537a691e36a6f41d50714905ba809e289.tar.gz inkscape-802a1a7537a691e36a6f41d50714905ba809e289.zip | |
update to trunk
(bzr r11950.1.258)
Diffstat (limited to 'src/ui/tools/pen-tool.cpp')
| -rw-r--r-- | src/ui/tools/pen-tool.cpp | 65 |
1 files changed, 40 insertions, 25 deletions
diff --git a/src/ui/tools/pen-tool.cpp b/src/ui/tools/pen-tool.cpp index a344dc7a6..9d9313102 100644 --- a/src/ui/tools/pen-tool.cpp +++ b/src/ui/tools/pen-tool.cpp @@ -149,29 +149,44 @@ const std::string& PenTool::getPrefsPath() { const std::string PenTool::prefsPath = "/tools/freehand/pen"; -PenTool::PenTool() : FreehandBase() { - this->polylines_only = false; - this->polylines_paraxial = false; - this->expecting_clicks_for_LPE = 0; - - this->cursor_shape = cursor_pen_xpm; - this->hot_x = 4; - this->hot_y = 4; - - this->npoints = 0; - this->mode = MODE_CLICK; - this->state = POINT; - - this->c0 = NULL; - this->c1 = NULL; - this->cl0 = NULL; - this->cl1 = NULL; - - this->events_disabled = 0; +PenTool::PenTool() + : FreehandBase(cursor_pen_xpm, 4, 4) + , p() + , npoints(0) + , mode(MODE_CLICK) + , state(POINT) + , polylines_only(false) + , polylines_paraxial(false) + , num_clicks(0) + , expecting_clicks_for_LPE(0) + , waiting_LPE(NULL) + , waiting_item(NULL) + , c0(NULL) + , c1(NULL) + , cl0(NULL) + , cl1(NULL) + , events_disabled(false) +{ +} - this->num_clicks = 0; - this->waiting_LPE = NULL; - this->waiting_item = NULL; +PenTool::PenTool(gchar const *const *cursor_shape, gint hot_x, gint hot_y) + : FreehandBase(cursor_shape, hot_x, hot_y) + , p() + , npoints(0) + , mode(MODE_CLICK) + , state(POINT) + , polylines_only(false) + , polylines_paraxial(false) + , num_clicks(0) + , expecting_clicks_for_LPE(0) + , waiting_LPE(NULL) + , waiting_item(NULL) + , c0(NULL) + , c1(NULL) + , cl0(NULL) + , cl1(NULL) + , events_disabled(false) +{ } PenTool::~PenTool() { @@ -2223,13 +2238,13 @@ static void spdc_pen_finish(PenTool *const pc, gboolean const closed) } static void pen_disable_events(PenTool *const pc) { - pc->events_disabled++; + pc->events_disabled = true; } static void pen_enable_events(PenTool *const pc) { - g_return_if_fail(pc->events_disabled != 0); + g_return_if_fail(pc->events_disabled != 0); - pc->events_disabled--; + pc->events_disabled = false; } void sp_pen_context_wait_for_LPE_mouse_clicks(PenTool *pc, Inkscape::LivePathEffect::EffectType effect_type, |
