From 28110b2774db11b4e8163e4e1e48387cd4608c7c Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 17 Jan 2007 02:27:36 +0000 Subject: [PATCH] fix flattening 2-d objects --- panda/src/pgraph/sceneGraphReducer.cxx | 3 +-- panda/src/pgui/pgEntry.cxx | 13 +++++++++++++ panda/src/pgui/pgEntry.h | 3 ++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/panda/src/pgraph/sceneGraphReducer.cxx b/panda/src/pgraph/sceneGraphReducer.cxx index c4e6893a16..371a43a6d7 100644 --- a/panda/src/pgraph/sceneGraphReducer.cxx +++ b/panda/src/pgraph/sceneGraphReducer.cxx @@ -426,9 +426,8 @@ flatten_siblings(PandaNode *parent_node, int combine_siblings_bits) { do_flatten_siblings(parent_node, child1, child2); if (new_node != (PandaNode *)NULL) { // We successfully collapsed a node. + (*ai1_hold) = new_node; nodes.erase(ai2_hold); - nodes.erase(ai1_hold); - nodes.push_back(new_node); ai1 = nodes.begin(); ai2 = nodes.end(); num_nodes++; diff --git a/panda/src/pgui/pgEntry.cxx b/panda/src/pgui/pgEntry.cxx index 1d68c27392..277db9dc41 100644 --- a/panda/src/pgui/pgEntry.cxx +++ b/panda/src/pgui/pgEntry.cxx @@ -122,6 +122,19 @@ make_copy() const { return new PGEntry(*this); } +//////////////////////////////////////////////////////////////////// +// Function: PGEntry::xform +// Access: Public, Virtual +// Description: Transforms the contents of this node by the indicated +// matrix, if it means anything to do so. For most +// kinds of nodes, this does nothing. +//////////////////////////////////////////////////////////////////// +void PGEntry:: +xform(const LMatrix4f &mat) { + PGItem::xform(mat); + _text_render_root.set_mat(_text_render_root.get_mat() * mat); +} + //////////////////////////////////////////////////////////////////// // Function: PGEntry::cull_callback // Access: Protected, Virtual diff --git a/panda/src/pgui/pgEntry.h b/panda/src/pgui/pgEntry.h index fdfa25ae1d..7179ebb2b4 100644 --- a/panda/src/pgui/pgEntry.h +++ b/panda/src/pgui/pgEntry.h @@ -51,7 +51,8 @@ protected: PGEntry(const PGEntry ©); public: - virtual PandaNode *make_copy() const; + virtual PandaNode *make_copy() const; + virtual void xform(const LMatrix4f &mat); virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data); virtual void press(const MouseWatcherParameter ¶m, bool background);