Browse Source

fix flatten

David Rose 23 years ago
parent
commit
f78419ceed
2 changed files with 15 additions and 0 deletions
  1. 12 0
      panda/src/text/textNode.cxx
  2. 3 0
      panda/src/text/textNode.h

+ 12 - 0
panda/src/text/textNode.cxx

@@ -458,6 +458,18 @@ decode_text(const string &text) const {
   };
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: TextNode::xform
+//       Access: Public, Virtual
+//  Description: Transforms the contents of this PandaNode by the
+//               indicated matrix, if it means anything to do so.  For
+//               most kinds of PandaNodes, this does nothing.
+////////////////////////////////////////////////////////////////////
+void TextNode::
+xform(const LMatrix4f &mat) {
+  _transform *= mat;
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: TextNode::decode_text_impl
 //       Access: Private

+ 3 - 0
panda/src/text/textNode.h

@@ -216,6 +216,9 @@ public:
   string encode_wtext(const wstring &wtext) const;
   wstring decode_text(const string &text) const;
 
+  // From parent class PandaNode
+  virtual void xform(const LMatrix4f &mat);
+
 private:
   wstring decode_text_impl(StringDecoder &decoder) const;
   int expand_amp_sequence(StringDecoder &decoder) const;