[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45756] trunk/blender/source/blender/ editors/mesh/editmesh_knife.c: bmesh knife tool:
Campbell Barton
ideasman42 at gmail.com
Wed Apr 18 18:55:16 CEST 2012
Revision: 45756
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45756
Author: campbellbarton
Date: 2012-04-18 16:55:15 +0000 (Wed, 18 Apr 2012)
Log Message:
-----------
bmesh knife tool:
fix for bug where not moving the mouse after pressing K and clicking would start the first point at the bottom left of the view.
Modified Paths:
--------------
trunk/blender/source/blender/editors/mesh/editmesh_knife.c
Modified: trunk/blender/source/blender/editors/mesh/editmesh_knife.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_knife.c 2012-04-18 16:27:11 UTC (rev 45755)
+++ trunk/blender/source/blender/editors/mesh/editmesh_knife.c 2012-04-18 16:55:15 UTC (rev 45756)
@@ -2736,6 +2736,17 @@
}
}
+static void knifetool_update_mval(knifetool_opdata *kcd, int mval[2])
+{
+ knife_recalc_projmat(kcd);
+ kcd->vc.mval[0] = mval[0];
+ kcd->vc.mval[1] = mval[1];
+
+ if (knife_update_active(kcd)) {
+ ED_region_tag_redraw(kcd->ar);
+ }
+}
+
/* called when modal loop selection gets set up... */
static int knifetool_init(bContext *C, wmOperator *op, int UNUSED(do_cut))
{
@@ -2818,8 +2829,7 @@
WM_event_add_modal_handler(C, op);
kcd = op->customdata;
- kcd->vc.mval[0] = evt->mval[0];
- kcd->vc.mval[1] = evt->mval[1];
+ knifetool_update_mval(kcd, evt->mval);
ED_area_headerprint(CTX_wm_area(C),
"LMB: define cut lines, Return or RMB: confirm, E: new cut, Ctrl: midpoint snap, "
@@ -2997,12 +3007,7 @@
case MOUSEMOVE: /* mouse moved somewhere to select another loop */
if (kcd->mode != MODE_PANNING) {
- knife_recalc_projmat(kcd);
- kcd->vc.mval[0] = event->mval[0];
- kcd->vc.mval[1] = event->mval[1];
-
- if (knife_update_active(kcd))
- ED_region_tag_redraw(kcd->ar);
+ knifetool_update_mval(kcd, event->mval);
}
break;
More information about the Bf-blender-cvs
mailing list