Changeset 17356

Show
Ignore:
Timestamp:
05/07/06 15:58:07 (3 years ago)
Author:
jackburton
Message:

BMenu::InvalidateLayout() should only sets a variable, the real invalidation is done on Draw() or AttachedToWindow() (like on R5). This fixes bug 567 (at least the crash in HotEdit)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • haiku/trunk/src/kits/interface/Menu.cpp

    r17282 r17356  
    285285        } 
    286286 
    287         if (!fAttachAborted) 
    288                 InvalidateLayout(); 
     287        if (!fAttachAborted) { 
     288                CacheFontInfo(); 
     289                LayoutItems(0);  
     290        } 
    289291} 
    290292 
     
    743745BMenu::Draw(BRect updateRect) 
    744746{ 
     747        if (!fUseCachedMenuLayout) { 
     748                fUseCachedMenuLayout = true; 
     749                CacheFontInfo(); 
     750                LayoutItems(0); 
     751                Invalidate(); 
     752                return; 
     753        } 
     754 
    745755        DrawBackground(updateRect); 
    746756        DrawItems(updateRect); 
     
    779789BMenu::InvalidateLayout() 
    780790{ 
    781         CacheFontInfo(); 
    782         LayoutItems(0); 
    783         Invalidate(); 
     791        fUseCachedMenuLayout = false; 
    784792} 
    785793