Browse Source

text: Fix issue with TextNode::set_text() called from non-App stage

Because TextEncoder is not pipeline-cycled, text_changed() should propagate text changes up to stage 0.

See #1070; this caused the frame rate meter to show 0.0 fps most of the frames.
rdb 5 years ago
parent
commit
8dd3301c43
1 changed files with 1 additions and 1 deletions
  1. 1 1
      panda/src/text/textNode.cxx

+ 1 - 1
panda/src/text/textNode.cxx

@@ -341,7 +341,7 @@ void TextNode::
 text_changed() {
 text_changed() {
   // Copy the text to this class, since TextEncoder doesn't store it in a
   // Copy the text to this class, since TextEncoder doesn't store it in a
   // pipeline-cycled manner.
   // pipeline-cycled manner.
-  CDWriter cdata(_cycler);
+  CDWriter cdata(_cycler, true);
   cdata->_text = TextEncoder::get_text();
   cdata->_text = TextEncoder::get_text();
   cdata->_wtext = TextEncoder::get_wtext();
   cdata->_wtext = TextEncoder::get_wtext();
   invalidate_with_measure(cdata);
   invalidate_with_measure(cdata);