Bug fix #1893
authorTon Roosendaal <ton@blender.org>
Fri, 26 Nov 2004 20:20:42 +0000 (20:20 +0000)
committerTon Roosendaal <ton@blender.org>
Fri, 26 Nov 2004 20:20:42 +0000 (20:20 +0000)
Option to switch left/right mouse didn't work for floating panels. It then
still selected stuff behind the button.
Was due to using wrong variable for events.

source/blender/src/drawoops.c
source/blender/src/editaction.c
source/blender/src/editnla.c
source/blender/src/editsound.c
source/blender/src/header_oops.c
source/blender/src/space.c
source/blender/src/toolbox.c

index 4cfae91c6652e76474511b28d4647244d2304b43..bb75986e571686df0686e9b0b5f36b807c75a8a4 100644 (file)
@@ -396,7 +396,6 @@ void drawoopsspace(ScrArea *sa, void *spacedata)
        SpaceOops *soops= spacedata;
        Oops *oops;
        float col[3];
-       int ofsx, ofsy;
        
        BIF_GetThemeColor3fv(TH_BACK, col);
        glClearColor(col[0], col[1], col[2], 0.0);
@@ -408,16 +407,6 @@ void drawoopsspace(ScrArea *sa, void *spacedata)
                boundbox_oops();
                calc_scrollrcts(G.v2d, curarea->winx, curarea->winy);
 
-               if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) {
-                       if(G.v2d->scroll) {     
-                               ofsx= curarea->winrct.xmin;     /* because of mywin */
-                               ofsy= curarea->winrct.ymin;
-
-                               glViewport(ofsx+G.v2d->mask.xmin,  ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1); 
-                               glScissor(ofsx+G.v2d->mask.xmin,  ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1);
-                       }
-               }
-
                myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
 
                oopscalex= .14*((float)curarea->winx)/(G.v2d->cur.xmax-G.v2d->cur.xmin);
@@ -453,8 +442,10 @@ void drawoopsspace(ScrArea *sa, void *spacedata)
        /* ortho at pixel level curarea */
        myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
 
-       if(sa->winx>SCROLLB+10 && sa->winy>SCROLLH+10) {
-               if(G.v2d->scroll) drawscroll(0);                
+       if(soops->type==SO_OUTLINER) {
+               if(sa->winx>SCROLLB+10 && sa->winy>SCROLLH+10) {
+                       if(G.v2d->scroll) drawscroll(0);                
+               }
        }
        draw_area_emboss(sa);   
        
index 0e2f4038eb494334f8ec0c11f6d4fa2c57204c98..45f9b850595e68fb2de11d8c4834514e0d818322 100644 (file)
@@ -2248,10 +2248,10 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                
                /* swap mouse buttons based on user preference */
                if (U.flag & USER_LMOUSESELECT) {
-                       if (evt->event == LEFTMOUSE) {
+                       if (event == LEFTMOUSE) {
                                event = RIGHTMOUSE;
                                mousebut = L_MOUSE;
-                       } else if (evt->event == RIGHTMOUSE) {
+                       } else if (event == RIGHTMOUSE) {
                                event = LEFTMOUSE;
                                mousebut = R_MOUSE;
                        }
index 63c236ba4523cafcf85e0442d75a0a42a95e91f4..a61fac1bdb6af2fc1248b337ea3421cb1454946f 100644 (file)
@@ -200,10 +200,10 @@ void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                
                /* swap mouse buttons based on user preference */
                if (U.flag & USER_LMOUSESELECT) {
-                       if (evt->event == LEFTMOUSE) {
+                       if (event == LEFTMOUSE) {
                                event = RIGHTMOUSE;
                                mousebut = L_MOUSE;
-                       } else if (evt->event == RIGHTMOUSE) {
+                       } else if (event == RIGHTMOUSE) {
                                event = LEFTMOUSE;
                                mousebut = R_MOUSE;
                        }
index 6b821772de8441b1bdee38e62595063ada049424..5093a6f57a139c413a85987b0eaca63aa580e748 100644 (file)
@@ -119,10 +119,10 @@ void winqreadsoundspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
 
                /* swap mouse buttons based on user preference */
                if (U.flag & USER_LMOUSESELECT) {
-                       if (evt->event == LEFTMOUSE) {
+                       if (event == LEFTMOUSE) {
                                event = RIGHTMOUSE;
                                mousebut = L_MOUSE;
-                       } else if (evt->event == RIGHTMOUSE) {
+                       } else if (event == RIGHTMOUSE) {
                                event = LEFTMOUSE;
                                mousebut = R_MOUSE;
                        }
index 630d2a8122fd6b0c86894bc25e08cc746cf7f9e4..24dcd19b97d7fd8b7ae36df5e6bbeedc60dea37f 100644 (file)
@@ -86,6 +86,7 @@ void do_oops_buttons(short event)
 
        switch(event) {
        case B_OOPSHOME:
+               init_v2d_oops(curarea, curarea->spacedata.first);       // forces min/max to be reset
                boundbox_oops();
                G.v2d->cur= G.v2d->tot;
                dx= 0.15*(G.v2d->cur.xmax-G.v2d->cur.xmin);
index e2f8007ff707883827e89be01dda3cec4dec20a7..be6706882c5d5c0a2f12ad304338aa2fc0b6b790 100644 (file)
@@ -729,11 +729,8 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                
                /* swap mouse buttons based on user preference */
                if (U.flag & USER_LMOUSESELECT) {
-                       if (evt->event == LEFTMOUSE) {
-                               event = RIGHTMOUSE;
-                       } else if (evt->event == RIGHTMOUSE) {
-                               event = LEFTMOUSE;
-                       }
+                       if (event==LEFTMOUSE) event = RIGHTMOUSE;
+                       else if (event==RIGHTMOUSE) event = LEFTMOUSE;
                }
                
                /* TEXTEDITING?? */
@@ -1762,10 +1759,10 @@ static void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
 
                /* swap mouse buttons based on user preference */
                if (U.flag & USER_LMOUSESELECT) {
-                       if (evt->event == LEFTMOUSE) {
+                       if (event == LEFTMOUSE) {
                                event = RIGHTMOUSE;
                                mousebut = L_MOUSE;
-                       } else if (evt->event == RIGHTMOUSE) {
+                       } else if (event == RIGHTMOUSE) {
                                event = LEFTMOUSE;
                                mousebut = R_MOUSE;
                        }
@@ -3091,10 +3088,10 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                
                /* swap mouse buttons based on user preference */
                if (U.flag & USER_LMOUSESELECT) {
-                       if (evt->event == LEFTMOUSE) {
+                       if (event == LEFTMOUSE) {
                                event = RIGHTMOUSE;
                                mousebut = L_MOUSE;
-                       } else if (evt->event == RIGHTMOUSE) {
+                       } else if (event == RIGHTMOUSE) {
                                event = LEFTMOUSE;
                                mousebut = R_MOUSE;
                        }
@@ -3541,10 +3538,10 @@ static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
        
        /* swap mouse buttons based on user preference */
        if (U.flag & USER_LMOUSESELECT) {
-               if (evt->event == LEFTMOUSE) {
+               if (event == LEFTMOUSE) {
                        event = RIGHTMOUSE;
                        mousebut = R_MOUSE;
-               } else if (evt->event == RIGHTMOUSE) {
+               } else if (event == RIGHTMOUSE) {
                        event = LEFTMOUSE;
                        mousebut = L_MOUSE;
                }
@@ -3841,13 +3838,10 @@ static void winqreadoopsspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
        else {  
                /* swap mouse buttons based on user preference */
                if (U.flag & USER_LMOUSESELECT) {
-                       if (evt->event == LEFTMOUSE) {
-                               event = RIGHTMOUSE;
-                       } else if (evt->event == RIGHTMOUSE) {
-                               event = LEFTMOUSE;
-                       }
+                       if (event==LEFTMOUSE) event = RIGHTMOUSE;
+                       else if (event==RIGHTMOUSE) event = LEFTMOUSE;
                }
-       
+               
                switch(event) {
                case LEFTMOUSE:
                        gesture();
index b7843154772a8d6999db6b0510276fd9ef34ca28..48d6919da7b6b36f01d489e276e99a6197423018 100644 (file)
@@ -1813,7 +1813,7 @@ static TBitem tb_mesh[]= {
 {      0, "Show/Hide Faces",                   3,              NULL},
 {      0, "Show/Hide Normals",                 4,              NULL},
 {      0, "SEPR",                                              0,      NULL},
-{      0, "Subdivision Surface|Shift O",               5,              NULL},
+{      0, "Subdivision Surface",               5,              NULL},
 {      0, "SubSurf Optimal",                   6,              NULL},
 {      0, "SEPR",                                              0, NULL},
 {      0, "Show/Hide Vertices",        0,              tb_obdata_hide},