From 600a70a7f205b30202b755b0a78530e614a834aa Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 21 Oct 2008 22:52:45 +0000 Subject: [PATCH] fix weird issues with buttons in shadowed text --- panda/src/pgraph/sceneGraphReducer.cxx | 4 ++++ panda/src/text/textAssembler.cxx | 7 ++++++- panda/src/text/textNode.cxx | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/panda/src/pgraph/sceneGraphReducer.cxx b/panda/src/pgraph/sceneGraphReducer.cxx index 5fc0f3c87b..a810ff5e8d 100644 --- a/panda/src/pgraph/sceneGraphReducer.cxx +++ b/panda/src/pgraph/sceneGraphReducer.cxx @@ -741,6 +741,10 @@ do_flatten_siblings(PandaNode *parent_node, PandaNode *child1, choose_name(new_child, child2, child1); + // Make sure the new child list has child1's children first, + // followed by child2's children. + child1->steal_children(child2); + new_child->replace_node(child1); new_child->replace_node(child2); diff --git a/panda/src/text/textAssembler.cxx b/panda/src/text/textAssembler.cxx index 6b6de230c7..cb6965c644 100644 --- a/panda/src/text/textAssembler.cxx +++ b/panda/src/text/textAssembler.cxx @@ -598,7 +598,12 @@ assemble_text() { // vertices. if (properties->has_shadow()) { placement->assign_copy_to(shadow_geom_node, shadow_state, shadow_xform); - placement->copy_graphic_to(shadow_node, shadow_state, shadow_xform); + + // Don't shadow the graphics. That can result in duplication of + // button objects, plus it looks weird. If you want a shadowed + // graphic, you can shadow it yourself before you add it. + //placement->copy_graphic_to(shadow_node, shadow_state, shadow_xform); + any_shadow = true; } placement->assign_to(text_geom_node, text_state); diff --git a/panda/src/text/textNode.cxx b/panda/src/text/textNode.cxx index 4b85f9aa7a..2e6ec8abfb 100644 --- a/panda/src/text/textNode.cxx +++ b/panda/src/text/textNode.cxx @@ -342,7 +342,7 @@ generate() { gr.apply_attribs(root); gr.flatten(root, ~SceneGraphReducer::CS_within_radius); gr.collect_vertex_data(root); - gr.unify(root, false); + gr.unify(root, true); } // Now deal with the decorations.