Browse Source

pgui: Revert part of f2e488fd6b39a6fca54c0be79378955157a266de

This caused a regression due to a removal of update_frame invocation in single-threaded pipeline, needs to be revisited later on master branch
rdb 4 years ago
parent
commit
fa73657d03
1 changed files with 4 additions and 7 deletions
  1. 4 7
      panda/src/pgui/pgItem.cxx

+ 4 - 7
panda/src/pgui/pgItem.cxx

@@ -1006,13 +1006,10 @@ get_frame_style(int state) {
 void PGItem::
 set_frame_style(int state, const PGFrameStyle &style) {
   LightReMutexHolder holder(_lock);
-
-  slot_state_def(state);
-
-  if (_state_defs[state]._root.is_empty()) {
-    // Create a new node.
-    _state_defs[state]._root = NodePath("state_" + format_string(state));
-  }
+  // Get the state def node, mainly to ensure that this state is slotted and
+  // listed as having been defined.
+  NodePath &root = do_get_state_def(state);
+  nassertv(!root.is_empty());
 
   _state_defs[state]._frame_style = style;
   _state_defs[state]._frame_stale = true;