Cary Sandvig 25 년 전
부모
커밋
5eb9483857
3개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      panda/src/gui/guiBackground.I
  2. 4 0
      panda/src/gui/guiBackground.cxx
  3. 2 0
      panda/src/gui/guiBackground.h

+ 4 - 0
panda/src/gui/guiBackground.I

@@ -17,3 +17,7 @@ INLINE void GuiBackground::set_color(const Colorf& c) {
 INLINE Colorf GuiBackground::get_color(void) const {
   return _bg->get_foreground_color();
 }
+
+INLINE void GuiBackground::reassert(void) {
+  _item->set_priority(_bg, P_High);
+}

+ 4 - 0
panda/src/gui/guiBackground.cxx

@@ -10,6 +10,10 @@ TypeHandle GuiBackground::_type_handle;
 
 void GuiBackground::recompute_frame(void) {
   _item->recompute();
+  _bg->set_width(_item->get_width());
+  _bg->set_height(_item->get_height());
+  _bg->set_pos(LVector3f::rfu((_item->get_left() + _item->get_right())*0.5, 0.,
+			      (_item->get_bottom() + _item->get_top())*0.5));
   _bg->recompute();
   GuiItem::recompute_frame();
 }

+ 2 - 0
panda/src/gui/guiBackground.h

@@ -38,6 +38,8 @@ PUBLISHED:
 
   virtual void output(ostream&) const;
 
+  INLINE void reassert(void);
+
 public:
   // type interface
   static TypeHandle get_class_type(void) {