Cary Sandvig 25 năm trước cách đây
mục cha
commit
5eb9483857

+ 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 {
 INLINE Colorf GuiBackground::get_color(void) const {
   return _bg->get_foreground_color();
   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) {
 void GuiBackground::recompute_frame(void) {
   _item->recompute();
   _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();
   _bg->recompute();
   GuiItem::recompute_frame();
   GuiItem::recompute_frame();
 }
 }

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

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