mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
Fix crash when using TextGraphic in texts
This commit is contained in:
parent
7e20626915
commit
54819dbcde
@ -544,32 +544,34 @@ assemble_text() {
|
||||
}
|
||||
}
|
||||
|
||||
if (properties->has_shadow()) {
|
||||
if (!placement._glyph.is_null()) {
|
||||
if (properties->has_shadow()) {
|
||||
if (_dynamic_merge) {
|
||||
if (placement._glyph->has_quad()) {
|
||||
placement.assign_quad_to(quad_shadow_map, shadow_state, shadow);
|
||||
} else {
|
||||
placement.assign_append_to(geom_shadow_collector_map, shadow_state, shadow);
|
||||
}
|
||||
} else {
|
||||
placement.assign_to(shadow_geom_node, shadow_state, shadow);
|
||||
}
|
||||
|
||||
// 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);
|
||||
any_shadow = true;
|
||||
}
|
||||
|
||||
if (_dynamic_merge) {
|
||||
if (placement._glyph->has_quad()) {
|
||||
placement.assign_quad_to(quad_shadow_map, shadow_state, shadow);
|
||||
placement.assign_quad_to(quad_map, text_state);
|
||||
} else {
|
||||
placement.assign_append_to(geom_shadow_collector_map, shadow_state, shadow);
|
||||
placement.assign_append_to(geom_collector_map, text_state);
|
||||
}
|
||||
} else {
|
||||
placement.assign_to(shadow_geom_node, shadow_state, shadow);
|
||||
placement.assign_to(text_geom_node, text_state);
|
||||
}
|
||||
|
||||
// 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);
|
||||
any_shadow = true;
|
||||
}
|
||||
|
||||
if (_dynamic_merge) {
|
||||
if (placement._glyph->has_quad()) {
|
||||
placement.assign_quad_to(quad_map, text_state);
|
||||
} else {
|
||||
placement.assign_append_to(geom_collector_map, text_state);
|
||||
}
|
||||
} else {
|
||||
placement.assign_to(text_geom_node, text_state);
|
||||
}
|
||||
placement.copy_graphic_to(text_node, text_state);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user