Bugfix #26483
authorTon Roosendaal <ton@blender.org>
Thu, 17 Mar 2011 14:52:01 +0000 (14:52 +0000)
committerTon Roosendaal <ton@blender.org>
Thu, 17 Mar 2011 14:52:01 +0000 (14:52 +0000)
Two small draw fixes to make the giant preview-image search-menu draw
correctly. (previews were drawing over a button)

source/blender/editors/interface/interface_regions.c

index 930999f05ffa3d6137538459925f9e7575814f3e..d2b1a4d8db863b8d97d149269ab4b75a9195d57e 100644 (file)
@@ -683,7 +683,7 @@ static void ui_searchbox_butrect(rcti *rect, uiSearchboxData *data, int itemnr)
                rect->xmin += col * butw;
                rect->xmax = rect->xmin + butw;
                
-               rect->ymax = data->bbox.ymax - (row * buth);
+               rect->ymax = data->bbox.ymax - MENU_TOP - (row * buth);
                rect->ymin = rect->ymax - buth;
        }
        /* list view */
@@ -985,7 +985,7 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but)
                data->bbox.ymax= (ar->winrct.ymax-ar->winrct.ymin) - MENU_SHADOW_BOTTOM;
                
                /* check if button is lower half */
-               if( but->y2 < (but->block->minx+but->block->maxx)/2 ) {
+               if( but->y2 < (but->block->miny+but->block->maxy)/2 ) {
                        data->bbox.ymin += (but->y2-but->y1);
                }
                else {