2.5: X11
[blender.git] / source / blender / editors / interface / view2d_ops.c
index 101d89da618180636cd1c9e4812d0156e6f5b7a5..14872f05f8a16be37b7d5bd69bbfdddaec58d3d9 100644 (file)
@@ -257,7 +257,7 @@ void VIEW2D_OT_pan(wmOperatorType *ot)
        ot->modal= view_pan_modal;
        
        /* operator is repeatable */
-       ot->flag= OPTYPE_REGISTER;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_BLOCKING;
        
        /* rna - must keep these in sync with the other operators */
        RNA_def_int(ot->srna, "deltax", 0, INT_MIN, INT_MAX, "Delta X", "", INT_MIN, INT_MAX);
@@ -832,7 +832,7 @@ void VIEW2D_OT_zoom(wmOperatorType *ot)
        ot->modal= view_zoomdrag_modal;
        
        /* operator is repeatable */
-       ot->flag= OPTYPE_REGISTER;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_BLOCKING;
        
        /* rna - must keep these in sync with the other operators */
        RNA_def_float(ot->srna, "deltax", 0, -FLT_MAX, FLT_MAX, "Delta X", "", -FLT_MAX, FLT_MAX);
@@ -1261,6 +1261,9 @@ void VIEW2D_OT_scroller_activate(wmOperatorType *ot)
        /* identifiers */
        ot->name= "Scroller Activate";
        ot->idname= "VIEW2D_OT_scroller_activate";
+
+       /* flags */
+       ot->flag= OPTYPE_BLOCKING;
        
        /* api callbacks */
        ot->invoke= scroller_activate_invoke;
@@ -1273,6 +1276,7 @@ void VIEW2D_OT_scroller_activate(wmOperatorType *ot)
 
 static int reset_exec(bContext *C, wmOperator *op)
 {
+       uiStyle *style= U.uistyles.first;
        ARegion *ar= CTX_wm_region(C);
        View2D *v2d= &ar->v2d;
        int winx, winy;
@@ -1283,26 +1287,26 @@ static int reset_exec(bContext *C, wmOperator *op)
 
        v2d->cur.xmax= v2d->cur.xmin + winx;
        v2d->cur.ymax= v2d->cur.ymin + winy;
-
+       
        /* align */
        if(v2d->align) {
                /* posx and negx flags are mutually exclusive, so watch out */
                if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) {
                        v2d->cur.xmax= 0.0f;
-                       v2d->cur.xmin= v2d->winx;
+                       v2d->cur.xmin= v2d->winx*style->panelzoom;
                }
                else if ((v2d->align & V2D_ALIGN_NO_NEG_X) && !(v2d->align & V2D_ALIGN_NO_POS_X)) {
-                       v2d->cur.xmax= v2d->cur.xmax - v2d->cur.xmin;
+                       v2d->cur.xmax= (v2d->cur.xmax - v2d->cur.xmin)*style->panelzoom;
                        v2d->cur.xmin= 0.0f;
                }
 
                /* - posx and negx flags are mutually exclusive, so watch out */
                if ((v2d->align & V2D_ALIGN_NO_POS_Y) && !(v2d->align & V2D_ALIGN_NO_NEG_Y)) {
                        v2d->cur.ymax= 0.0f;
-                       v2d->cur.ymin= -v2d->winy;
+                       v2d->cur.ymin= -v2d->winy*style->panelzoom;
                }
                else if ((v2d->align & V2D_ALIGN_NO_NEG_Y) && !(v2d->align & V2D_ALIGN_NO_POS_Y)) {
-                       v2d->cur.ymax= v2d->cur.ymax - v2d->cur.ymin;
+                       v2d->cur.ymax= (v2d->cur.ymax - v2d->cur.ymin)*style->panelzoom;
                        v2d->cur.ymin= 0.0f;
                }
        }