@@ -158,6 +158,7 @@ motion_event_handler(struct mged_state *s, XMotionEvent *xmotion)
158
158
fastf_t f ;
159
159
fastf_t fx , fy ;
160
160
fastf_t td ;
161
+ int edit_mode = ((GEOM_EDIT_STATE == ST_S_EDIT || GEOM_EDIT_STATE == ST_O_EDIT ) && mged_variables -> mv_transform == 'e' ) ? 1 : 0 ;
161
162
162
163
if (s -> dbip == DBI_NULL )
163
164
return ;
@@ -219,8 +220,7 @@ motion_event_handler(struct mged_state *s, XMotionEvent *xmotion)
219
220
save_coords = mged_variables -> mv_coords ;
220
221
mged_variables -> mv_coords = 'v' ;
221
222
222
- if ((GEOM_EDIT_STATE == ST_S_EDIT || GEOM_EDIT_STATE == ST_O_EDIT ) &&
223
- mged_variables -> mv_transform == 'e' ) {
223
+ if (edit_mode ) {
224
224
225
225
if (GEOM_EDIT_STATE == ST_S_EDIT ) {
226
226
save_edflag = es_edflag ;
@@ -263,8 +263,7 @@ motion_event_handler(struct mged_state *s, XMotionEvent *xmotion)
263
263
fx = dx / (fastf_t )width * 2.0 ;
264
264
fy = - dy / (fastf_t )height / dm_get_aspect (DMP ) * 2.0 ;
265
265
266
- if ((GEOM_EDIT_STATE == ST_S_EDIT || GEOM_EDIT_STATE == ST_O_EDIT ) &&
267
- mged_variables -> mv_transform == 'e' ) {
266
+ if (edit_mode ) {
268
267
269
268
if (GEOM_EDIT_STATE == ST_S_EDIT ) {
270
269
save_edflag = es_edflag ;
@@ -329,8 +328,7 @@ motion_event_handler(struct mged_state *s, XMotionEvent *xmotion)
329
328
goto reset_edflag ;
330
329
}
331
330
case AMM_SCALE :
332
- if ((GEOM_EDIT_STATE == ST_S_EDIT || GEOM_EDIT_STATE == ST_O_EDIT ) &&
333
- mged_variables -> mv_transform == 'e' ) {
331
+ if (edit_mode ) {
334
332
if (GEOM_EDIT_STATE == ST_S_EDIT && !SEDIT_SCALE ) {
335
333
save_edflag = es_edflag ;
336
334
es_edflag = SSCALE ;
@@ -387,8 +385,7 @@ motion_event_handler(struct mged_state *s, XMotionEvent *xmotion)
387
385
388
386
break ;
389
387
case AMM_CON_ROT_X :
390
- if ((GEOM_EDIT_STATE == ST_S_EDIT || GEOM_EDIT_STATE == ST_O_EDIT ) &&
391
- mged_variables -> mv_transform == 'e' ) {
388
+ if (edit_mode ) {
392
389
if (GEOM_EDIT_STATE == ST_S_EDIT ) {
393
390
save_edflag = es_edflag ;
394
391
if (!SEDIT_ROTATE )
@@ -412,8 +409,7 @@ motion_event_handler(struct mged_state *s, XMotionEvent *xmotion)
412
409
413
410
break ;
414
411
case AMM_CON_ROT_Y :
415
- if ((GEOM_EDIT_STATE == ST_S_EDIT || GEOM_EDIT_STATE == ST_O_EDIT ) &&
416
- mged_variables -> mv_transform == 'e' ) {
412
+ if (edit_mode ) {
417
413
if (GEOM_EDIT_STATE == ST_S_EDIT ) {
418
414
save_edflag = es_edflag ;
419
415
if (!SEDIT_ROTATE )
@@ -437,8 +433,7 @@ motion_event_handler(struct mged_state *s, XMotionEvent *xmotion)
437
433
438
434
break ;
439
435
case AMM_CON_ROT_Z :
440
- if ((GEOM_EDIT_STATE == ST_S_EDIT || GEOM_EDIT_STATE == ST_O_EDIT ) &&
441
- mged_variables -> mv_transform == 'e' ) {
436
+ if (edit_mode ) {
442
437
if (GEOM_EDIT_STATE == ST_S_EDIT ) {
443
438
save_edflag = es_edflag ;
444
439
if (!SEDIT_ROTATE )
@@ -462,8 +457,7 @@ motion_event_handler(struct mged_state *s, XMotionEvent *xmotion)
462
457
463
458
break ;
464
459
case AMM_CON_TRAN_X :
465
- if ((GEOM_EDIT_STATE == ST_S_EDIT || GEOM_EDIT_STATE == ST_O_EDIT ) &&
466
- mged_variables -> mv_transform == 'e' ) {
460
+ if (edit_mode ) {
467
461
if (GEOM_EDIT_STATE == ST_S_EDIT ) {
468
462
save_edflag = es_edflag ;
469
463
if (!SEDIT_TRAN )
@@ -486,8 +480,7 @@ motion_event_handler(struct mged_state *s, XMotionEvent *xmotion)
486
480
487
481
break ;
488
482
case AMM_CON_TRAN_Y :
489
- if ((GEOM_EDIT_STATE == ST_S_EDIT || GEOM_EDIT_STATE == ST_O_EDIT ) &&
490
- mged_variables -> mv_transform == 'e' ) {
483
+ if (edit_mode ) {
491
484
if (GEOM_EDIT_STATE == ST_S_EDIT ) {
492
485
save_edflag = es_edflag ;
493
486
if (!SEDIT_TRAN )
@@ -510,8 +503,7 @@ motion_event_handler(struct mged_state *s, XMotionEvent *xmotion)
510
503
511
504
break ;
512
505
case AMM_CON_TRAN_Z :
513
- if ((GEOM_EDIT_STATE == ST_S_EDIT || GEOM_EDIT_STATE == ST_O_EDIT ) &&
514
- mged_variables -> mv_transform == 'e' ) {
506
+ if (edit_mode ) {
515
507
if (GEOM_EDIT_STATE == ST_S_EDIT ) {
516
508
save_edflag = es_edflag ;
517
509
if (!SEDIT_TRAN )
@@ -534,8 +526,7 @@ motion_event_handler(struct mged_state *s, XMotionEvent *xmotion)
534
526
535
527
break ;
536
528
case AMM_CON_SCALE_X :
537
- if ((GEOM_EDIT_STATE == ST_S_EDIT || GEOM_EDIT_STATE == ST_O_EDIT ) &&
538
- mged_variables -> mv_transform == 'e' ) {
529
+ if (edit_mode ) {
539
530
if (GEOM_EDIT_STATE == ST_S_EDIT ) {
540
531
save_edflag = es_edflag ;
541
532
if (!SEDIT_SCALE )
@@ -558,8 +549,7 @@ motion_event_handler(struct mged_state *s, XMotionEvent *xmotion)
558
549
559
550
break ;
560
551
case AMM_CON_SCALE_Y :
561
- if ((GEOM_EDIT_STATE == ST_S_EDIT || GEOM_EDIT_STATE == ST_O_EDIT ) &&
562
- mged_variables -> mv_transform == 'e' ) {
552
+ if (edit_mode ) {
563
553
if (GEOM_EDIT_STATE == ST_S_EDIT ) {
564
554
save_edflag = es_edflag ;
565
555
if (!SEDIT_SCALE )
@@ -582,8 +572,7 @@ motion_event_handler(struct mged_state *s, XMotionEvent *xmotion)
582
572
583
573
break ;
584
574
case AMM_CON_SCALE_Z :
585
- if ((GEOM_EDIT_STATE == ST_S_EDIT || GEOM_EDIT_STATE == ST_O_EDIT ) &&
586
- mged_variables -> mv_transform == 'e' ) {
575
+ if (edit_mode ) {
587
576
if (GEOM_EDIT_STATE == ST_S_EDIT ) {
588
577
save_edflag = es_edflag ;
589
578
if (!SEDIT_SCALE )
0 commit comments