From 8c817ead913533f39691a64270982c0819744ad2 Mon Sep 17 00:00:00 2001 From: MenTaLguY Date: Sun, 4 Mar 2007 04:23:10 +0000 Subject: redo NR::Maybe to be less clever (bzr r2532) --- src/shape-editor.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/shape-editor.cpp') diff --git a/src/shape-editor.cpp b/src/shape-editor.cpp index 491037bd1..d9eaf11bc 100644 --- a/src/shape-editor.cpp +++ b/src/shape-editor.cpp @@ -229,7 +229,11 @@ bool ShapeEditor::is_over_stroke (NR::Point event_p, bool remember) { sp_nodepath_ensure_livarot_path(this->nodepath); NR::Maybe position = get_nearest_position_on_Path(this->nodepath->livarot_path, this->curvepoint_doc); - NR::Point nearest = get_point_on_Path(this->nodepath->livarot_path, position.assume().piece, position.assume().t); + if (!position) { + return false; + } + + NR::Point nearest = get_point_on_Path(this->nodepath->livarot_path, position->piece, position->t); NR::Point delta = nearest - this->curvepoint_doc; delta = desktop->d2w(delta); @@ -248,8 +252,8 @@ bool ShapeEditor::is_over_stroke (NR::Point event_p, bool remember) { this->curvepoint_event[NR::X] = (gint) event_p [NR::X]; this->curvepoint_event[NR::Y] = (gint) event_p [NR::Y]; this->hit = true; - this->grab_t = position.assume().t; - this->grab_node = position.assume().piece; + this->grab_t = position->t; + this->grab_node = position->piece; } return close; -- cgit v1.2.3