Browse Source

fix weird issues with buttons in shadowed text

David Rose 17 years ago
parent
commit
600a70a7f2

+ 4 - 0
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);
 

+ 6 - 1
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);

+ 1 - 1
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.