Changeset 491

Show
Ignore:
Timestamp:
03/17/2008 09:30:56 (5 months ago)
Author:
why
Message:
  • shoes/ruby.c: ever since i started computing the layout before painting it, the CHANGED_COORDS() test no longer applies.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/shoes/ruby.c

    r490 r491  
    528528  } 
    529529 
    530 #define CHANGED_COORDS() self_t->place.x != place.x || self_t->place.y != place.y || self_t->place.w != place.w || self_t->place.h - HEIGHT_PAD != place.h 
     530#define CHANGED_COORDS() self_t->place.ix != place.ix || self_t->place.iy != place.iy || self_t->place.iw != place.iw || self_t->place.ih - HEIGHT_PAD != place.ih 
    531531#define PLACE_COORDS() place.h -= HEIGHT_PAD; place.ih -= HEIGHT_PAD; self_t->place = place 
    532532 
     
    539539 
    540540#define PLACE_CONTROL() \ 
     541  PLACE_COORDS(); \ 
    541542  gtk_widget_set_size_request(self_t->ref, place.iw, place.ih); \ 
    542543  gtk_layout_put(GTK_LAYOUT(canvas->slot.canvas), self_t->ref, place.ix, place.iy); \ 
    543544  gtk_widget_show_all(self_t->ref); \ 
    544   PLACE_COORDS(); 
    545545 
    546546#define REPAINT_CONTROL() \ 
    547   if (CHANGED_COORDS()) { \ 
    548     gtk_layout_move(GTK_LAYOUT(canvas->slot.canvas), self_t->ref, place.ix, place.iy); \ 
    549     gtk_widget_set_size_request(self_t->ref, place.iw, place.ih); \ 
    550     PLACE_COORDS(); \ 
    551   } \ 
     547  PLACE_COORDS(); \ 
     548  gtk_layout_move(GTK_LAYOUT(canvas->slot.canvas), self_t->ref, place.ix, place.iy); \ 
     549  gtk_widget_set_size_request(self_t->ref, place.iw, place.ih); \ 
    552550  if (canvas->slot.expose != NULL) \ 
    553551  { \ 
     
    568566#define PLACE_CONTROL() \ 
    569567  HIRect hr; \ 
     568  PLACE_COORDS(); \ 
    570569  hr.origin.x = place.ix; hr.origin.y = place.iy; \ 
    571   hr.size.width = place.iw; hr.size.height = place.ih - HEIGHT_PAD; \ 
     570  hr.size.width = place.iw; hr.size.height = place.ih; \ 
    572571  HIViewAddSubview(canvas->slot.view, self_t->ref); \ 
    573572  SetControlCommandID(self_t->ref, SHOES_CONTROL1 + RARRAY_LEN(canvas->slot.controls)); \ 
     
    576575  HIViewSetVisible(self_t->ref, true); \ 
    577576  rb_ary_push(canvas->slot.controls, self); \ 
    578   PLACE_COORDS(); 
    579577 
    580578#define REPAINT_CONTROL() \ 
    581   if (CHANGED_COORDS()) { \ 
    582     HIRect hr; \ 
    583     hr.origin.x = place.ix; hr.origin.y = place.iy; \ 
    584     hr.size.width = place.iw; hr.size.height = place.ih - HEIGHT_PAD; \ 
    585     HIViewSetFrame(self_t->ref, &hr); \ 
    586     PLACE_COORDS(); \ 
    587   } 
     579  HIRect hr; \ 
     580  PLACE_COORDS(); \ 
     581  hr.origin.x = place.ix; hr.origin.y = place.iy; \ 
     582  hr.size.width = place.iw; hr.size.height = place.ih; \ 
     583  HIViewSetFrame(self_t->ref, &hr); 
    588584 
    589585static CFStringRef 
     
    627623#define REPAINT_CONTROL() \ 
    628624  place.iy -= canvas->slot.scrolly; \ 
    629   if (CHANGED_COORDS()) { \ 
    630     PLACE_CONTROL(); \ 
    631   } \ 
     625  PLACE_CONTROL(); \ 
    632626  place.iy += canvas->slot.scrolly 
    633627