Ignore:
Timestamp:
May 15, 2011, 6:22:08 AM (11 years ago)
Author:
Sam Hocevar
Message:

imlib: refactor a few image methods so that they use vec2i.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/imlib/guistat.cpp

    r644 r655  
    5656void gui_status_manager::draw_bar(gui_status_node *whom, int perc)
    5757{
    58   long l=whom->stat_win->x2()-whom->stat_win->x1()-6;
    59   long h=wm->font()->height();
     58    long l = whom->stat_win->x2() - whom->stat_win->x1() - 6;
     59    long h = wm->font()->height();
    6060
    61   whom->stat_win->m_surf->bar(whom->stat_win->x1()+1,whom->stat_win->y2()-h-1,whom->stat_win->x2()-1,
    62               whom->stat_win->y2()-1,wm->black());
    63   whom->stat_win->m_surf->bar(whom->stat_win->x1()+2,whom->stat_win->y2()-h,whom->stat_win->x2()-2,
    64               whom->stat_win->y2()-2,wm->dark_color());
    65   if (perc)
    66     whom->stat_win->m_surf->bar(whom->stat_win->x1()+3,whom->stat_win->y2()-h+1,
    67                 whom->stat_win->x1()+l*perc/100,
    68                 whom->stat_win->y2()-3,wm->bright_color());
     61    whom->stat_win->m_surf->Bar(vec2i(whom->stat_win->x1() + 1,
     62                                      whom->stat_win->y2() - h - 1),
     63                                vec2i(whom->stat_win->x2() - 1,
     64                                      whom->stat_win->y2() - 1),
     65                                wm->black());
     66    whom->stat_win->m_surf->Bar(vec2i(whom->stat_win->x1() + 2,
     67                                      whom->stat_win->y2() - h),
     68                                vec2i(whom->stat_win->x2() - 2,
     69                                      whom->stat_win->y2() - 2),
     70                                wm->dark_color());
     71    if (perc)
     72        whom->stat_win->m_surf->Bar(vec2i(whom->stat_win->x1() + 3,
     73                                          whom->stat_win->y2() - h + 1),
     74                                    vec2i(whom->stat_win->x1() + l * perc / 100,
     75                                          whom->stat_win->y2() - 3),
     76                                    wm->bright_color());
    6977}
    7078
Note: See TracChangeset for help on using the changeset viewer.