Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2014-01-01 08:17:57 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-01-01 08:27:17 +0400
commitd8f4cb9b690be374ee91fe76f6f880b546aef72a (patch)
tree5dc85b95643d90de33a94e756b0bb30da5ae7e12 /source/blender/editors/mesh
parentbf0231f297908b0dc232a17e47ad391607daf6fb (diff)
Fix T37965, loop multicut confirmation not happening when numeric input
is used. When numerical input was active confirmation events were not getting handled. Code here seems a bit duplicated, it may be possible to simplify it, but leaving it slightly bloated for now.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r--source/blender/editors/mesh/editmesh_loopcut.c57
1 files changed, 36 insertions, 21 deletions
diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c
index fd24981bde0..bc4281904b8 100644
--- a/source/blender/editors/mesh/editmesh_loopcut.c
+++ b/source/blender/editors/mesh/editmesh_loopcut.c
@@ -526,6 +526,29 @@ static int loopcut_exec(bContext *C, wmOperator *op)
return loopcut_init(C, op, NULL);
}
+static int loopcut_finish(RingSelOpData *lcd, bContext *C, wmOperator *op)
+{
+ /* finish */
+ ED_region_tag_redraw(lcd->ar);
+ ED_area_headerprint(CTX_wm_area(C), NULL);
+
+ if (lcd->eed) {
+ /* set for redo */
+ BM_mesh_elem_index_ensure(lcd->em->bm, BM_EDGE);
+ RNA_int_set(op->ptr, "edge_index", BM_elem_index_get(lcd->eed));
+
+ /* execute */
+ ringsel_finish(C, op);
+ ringsel_exit(C, op);
+ }
+ else {
+ ringcut_cancel(C, op);
+ return OPERATOR_CANCELLED;
+ }
+
+ return OPERATOR_FINISHED;
+}
+
static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event)
{
float smoothness = RNA_float_get(op->ptr, "smoothness");
@@ -554,6 +577,17 @@ static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event)
ED_region_tag_redraw(lcd->ar);
}
+ else {
+ switch (event->type) {
+ case RETKEY:
+ case PADENTER:
+ case LEFTMOUSE: /* confirm */ // XXX hardcoded
+ return loopcut_finish(lcd, C, op);
+ default:
+ /* do nothing */;
+ break;
+ }
+ }
}
else {
bool handled = false;
@@ -561,27 +595,8 @@ static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event)
case RETKEY:
case PADENTER:
case LEFTMOUSE: /* confirm */ // XXX hardcoded
- if (event->val == KM_PRESS) {
- /* finish */
- ED_region_tag_redraw(lcd->ar);
- ED_area_headerprint(CTX_wm_area(C), NULL);
-
- if (lcd->eed) {
- /* set for redo */
- BM_mesh_elem_index_ensure(lcd->em->bm, BM_EDGE);
- RNA_int_set(op->ptr, "edge_index", BM_elem_index_get(lcd->eed));
-
- /* execute */
- ringsel_finish(C, op);
- ringsel_exit(C, op);
- }
- else {
- ringcut_cancel(C, op);
- return OPERATOR_CANCELLED;
- }
-
- return OPERATOR_FINISHED;
- }
+ if (event->val == KM_PRESS)
+ return loopcut_finish(lcd, C, op);
ED_region_tag_redraw(lcd->ar);
handled = true;