Revision: 20627
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20627
Author:   ton
Date:     2009-06-04 17:19:48 +0200 (Thu, 04 Jun 2009)

Log Message:
-----------
2.5

Bugfix: Icons were drawing on wrong subpixel positions, distorting
badly. Now it's crispy and tasty!

Noticed there's a magnifier icon already, using it for the search
option.

Modified Paths:
--------------
    
branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c
    branches/blender2.5/blender/source/blender/editors/space_info/info_header.c
    
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_operators.c

Modified: 
branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c
    2009-06-04 14:32:10 UTC (rev 20626)
+++ 
branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c
    2009-06-04 15:19:48 UTC (rev 20627)
@@ -630,11 +630,16 @@
 
 static void widget_draw_icon(uiBut *but, BIFIconID icon, int blend, rcti *rect)
 {
-       float xs=0, ys=0, aspect, height;
+       int xs=0, ys=0;
+       float aspect, height;
        
        /* this icon doesn't need draw... */
        if(icon==ICON_BLANK1 && (but->flag & UI_ICON_SUBMENU)==0) return;
        
+       if(icon==ICON_VIEWZOOM) {
+               printf("viewzoom\n");
+       }
+       
        /* we need aspect from block, for menus... these buttons are scaled in 
uiPositionBlock() */
        aspect= but->block->aspect;
        if(aspect != but->aspect) {
@@ -663,33 +668,33 @@
                if(but->flag & UI_ICON_LEFT) {
                        if (but->type==BUT_TOGDUAL) {
                                if (but->drawstr[0]) {
-                                       xs= rect->xmin-1.0;
+                                       xs= rect->xmin-1;
                                } else {
-                                       xs= (rect->xmin+rect->xmax- height)/2.0;
+                                       xs= (rect->xmin+rect->xmax- height)/2;
                                }
                        }
                        else if (but->block->flag & UI_BLOCK_LOOP) {
-                               xs= rect->xmin+1.0;
+                               xs= rect->xmin+1;
                        }
                        else if ((but->type==ICONROW) || 
(but->type==ICONTEXTROW)) {
-                               xs= rect->xmin+3.0;
+                               xs= rect->xmin+3;
                        }
                        else {
-                               xs= rect->xmin+4.0;
+                               xs= rect->xmin+4;
                        }
-                       ys= (rect->ymin+rect->ymax- height)/2.0;
+                       ys= (rect->ymin+rect->ymax- height)/2;
                }
                else {
-                       xs= (rect->xmin+rect->xmax- height)/2.0;
-                       ys= (rect->ymin+rect->ymax- height)/2.0;
+                       xs= (rect->xmin+rect->xmax- height)/2;
+                       ys= (rect->ymin+rect->ymax- height)/2;
                }
        
                UI_icon_draw_aspect_blended(xs, ys, icon, aspect, blend);
        }
        
        if(but->flag & UI_ICON_SUBMENU) {
-               xs= rect->xmax-17.0;
-               ys= (rect->ymin+rect->ymax- height)/2.0;
+               xs= rect->xmax-17;
+               ys= (rect->ymin+rect->ymax- height)/2;
                
                UI_icon_draw_aspect_blended(xs, ys, ICON_RIGHTARROW_THIN, 
aspect, blend);
        }

Modified: 
branches/blender2.5/blender/source/blender/editors/space_info/info_header.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_info/info_header.c 
2009-06-04 14:32:10 UTC (rev 20626)
+++ branches/blender2.5/blender/source/blender/editors/space_info/info_header.c 
2009-06-04 15:19:48 UTC (rev 20627)
@@ -489,7 +489,7 @@
        
        {
                static char search[256]= "";
-               uiBut *but= uiDefSearchBut(block, search, 0, ICON_PROP_ON, 256, 
xco+5, yco, 120, 19, "");
+               uiBut *but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, 
256, xco+5, yco, 120, 19, "");
                
                uiButSetSearchFunc(but, operator_search_cb, NULL, 
operator_call_cb);
 

Modified: 
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_operators.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_operators.c  
    2009-06-04 14:32:10 UTC (rev 20626)
+++ 
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_operators.c  
    2009-06-04 15:19:48 UTC (rev 20627)
@@ -420,7 +420,7 @@
        block= uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
        uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_RET_1);
        
-       but= uiDefSearchBut(block, search, 0, ICON_PROP_ON, 256, 10, 10, 180, 
19, "");
+       but= uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, 256, 10, 10, 180, 
19, "");
        uiButSetSearchFunc(but, operator_search_cb, NULL, operator_call_cb);
        
        uiPopupBoundsBlock(block, 0.0f, 0, -20); /* move it downwards, mouse 
over button */


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to