Ignore:
Timestamp:
May 15, 2011, 6:22:08 AM (12 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/input.cpp

    r650 r655  
    316316  if (active)
    317317  {
    318     screen->rectangle(xstart(),y,xend(),yend(),wm->bright_color());
     318    screen->Rectangle(vec2i(xstart(), y), vec2i(xend(), yend()),
     319                      wm->bright_color());
    319320    draw_cur(wm->bright_color(),screen);
    320321  }
    321322  else
    322323  {
    323     screen->rectangle(xstart(),y,xend(),yend(),wm->dark_color());
     324    screen->Rectangle(vec2i(xstart(), y), vec2i(xend(), yend()),
     325                      wm->dark_color());
    324326    draw_cur(wm->dark_color(),screen);
    325327  }
     
    399401  else
    400402  {
    401     screen->rectangle(x1+2,y1+2,x2-2,y2-2,color);
    402     act=active;
     403    screen->Rectangle(vec2i(x1 + 2, y1 + 2), vec2i(x2 - 2, y2 - 2), color);
     404    act = active;
    403405  }
    404406}
     
    417419    if (up)
    418420    {
    419       screen->rectangle(x1,y1,x2,y2,wm->black());
     421      screen->Rectangle(vec2i(x1, y1), vec2i(x2, y2), wm->black());
    420422//      screen->widget_bar(,wm->bright_color(),wm->medium_color(),wm->dark_color());
    421       screen->widget_bar(x1+1,y1+1,x2-1,y2-1,wm->bright_color(),wm->medium_color(),wm->dark_color());
     423      screen->WidgetBar(vec2i(x1 + 1, y1 + 1), vec2i(x2 - 1, y2 - 1),
     424                        wm->bright_color(),wm->medium_color(),wm->dark_color());
    422425      if (text)
    423426      {
     
    428431    } else
    429432    {
    430       screen->line(x1,y1,x2,y1,wm->dark_color());
    431       screen->line(x1,y1,x1,y2,wm->dark_color());
    432       screen->line(x2,y1+1,x2,y2,wm->bright_color());
    433       screen->line(x1+1,y2,x2,y2,wm->bright_color());
    434       screen->bar(x1+1,y1+1,x2-1,y2-1,wm->medium_color());
     433      screen->Line(vec2i(x1, y1), vec2i(x2, y1), wm->dark_color());
     434      screen->Line(vec2i(x1, y1), vec2i(x1, y2), wm->dark_color());
     435      screen->Line(vec2i(x2, y1 + 1), vec2i(x2, y2), wm->bright_color());
     436      screen->Line(vec2i(x1 + 1, y2), vec2i(x2, y2), wm->bright_color());
     437      screen->Bar(vec2i(x1 + 1, y1 + 1), vec2i(x2 - 1, y2 - 1),
     438                  wm->medium_color());
    435439      if (visual)
    436440        screen->PutImage(visual, vec2i(x1 + 3, y1 + 3), 1);
     
    447451{
    448452  wm->font()->put_string(screen,x,y+3,prompt);
    449   screen->bar(xstart(),y,xend(),yend(),wm->dark_color());
     453  screen->Bar(vec2i(xstart(), y), vec2i(xend(), yend()), wm->dark_color());
    450454  wm->font()->put_string(screen,xstart()+1,y+3,data);
    451455}
     
    454458void text_field::draw_cur(int color, image *screen)
    455459{
    456   screen->bar(xstart()+cur*wm->font()->width()+1,
    457                       yend()-2,
    458                       xstart()+(cur+1)*wm->font()->width(),
    459                       yend()-1,color);
     460  screen->Bar(vec2i(xstart() + cur * wm->font()->width() + 1, yend() - 2),
     461              vec2i(xstart() + (cur + 1) * wm->font()->width(), yend() - 1),
     462              color);
    460463}
    461464
Note: See TracChangeset for help on using the changeset viewer.