mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
fix crash when no default font available
This commit is contained in:
parent
3c5b129f40
commit
6d21f840bd
@ -45,7 +45,11 @@ FrameRateMeter(const string &name) : TextNode(name) {
|
|||||||
|
|
||||||
// The top of the visible frame is 80% of the line height, based on
|
// The top of the visible frame is 80% of the line height, based on
|
||||||
// the calculation within TextAssembler.
|
// the calculation within TextAssembler.
|
||||||
float height = get_font()->get_line_height() * 0.8;
|
float height = 1.0f;
|
||||||
|
TextFont *font = get_font();
|
||||||
|
if (font != NULL){
|
||||||
|
height = font->get_line_height() * 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
set_align(A_right);
|
set_align(A_right);
|
||||||
set_transform(LMatrix4f::scale_mat(frame_rate_meter_scale) *
|
set_transform(LMatrix4f::scale_mat(frame_rate_meter_scale) *
|
||||||
|
Loading…
x
Reference in New Issue
Block a user