diff options
author | Campbell Barton <ideasman42@gmail.com> | 2006-06-27 17:37:16 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2006-06-27 17:37:16 +0400 |
commit | 31416d8d7e7fca90b30a579ddcc036fade804f9d (patch) | |
tree | ffd7192656f01383ac97e8e9f181947ac445719c /source/blender/src/interface_panel.c | |
parent | cd7cbc1e471c7c20d4cea577aa7ecf1809503b17 (diff) |
The tab clickable area was a bit off (10px or so when zoomed in) now its a lot better though not 100% perfect abt 2-3px out.
Diffstat (limited to 'source/blender/src/interface_panel.c')
-rw-r--r-- | source/blender/src/interface_panel.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/src/interface_panel.c b/source/blender/src/interface_panel.c index 899094e356f..e61d80c6121 100644 --- a/source/blender/src/interface_panel.c +++ b/source/blender/src/interface_panel.c @@ -1734,7 +1734,11 @@ static void ui_panel_untab(uiBlock *block) static void panel_clicked_tabs(uiBlock *block, int mousex) { Panel *pa, *tabsel=NULL, *panel= block->panel; - int nr= 1, a, width; + int nr= 1, a, width, ofsx; + + ofsx= PNL_ICON; + if(block->panel->control & UI_PNL_CLOSE) ofsx+= PNL_ICON; + /* count */ pa= curarea->panels.first; @@ -1749,12 +1753,13 @@ static void panel_clicked_tabs(uiBlock *block, int mousex) /* find clicked tab, mouse in panel coords */ a= 0; - width= (panel->sizex - 3- 2*PNL_ICON)/nr; + width= (int)((float)(panel->sizex - ofsx-10)/nr); pa= curarea->panels.first; while(pa) { if(pa==panel || pa->paneltab==panel) { - if( (mousex > PNL_ICON+a*width) && (mousex < PNL_ICON+(a+1)*width) ) { + if( (mousex > ofsx+a*width) && (mousex < ofsx+(a+1)*width) ) { tabsel= pa; + break; } a++; } |