From b6028f807914d8e3271a2fcc393686fa83212a02 Mon Sep 17 00:00:00 2001 From: Jinhao Date: Mon, 1 Oct 2018 07:43:57 +0800 Subject: [PATCH] fix bug that font is missing when measure a zero-sized label --- source/gui/widgets/label.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/gui/widgets/label.cpp b/source/gui/widgets/label.cpp index 88fe88f2..74bedf81 100644 --- a/source/gui/widgets/label.cpp +++ b/source/gui/widgets/label.cpp @@ -891,7 +891,8 @@ namespace nana if(graph_ptr->empty()) { graph_ptr = &substitute; - graph_ptr->make({ 10, 10 }); + substitute.make({ 10, 10 }); + substitute.typeface(this->typeface()); } return impl->renderer.measure(*graph_ptr, limited, impl->text_align, impl->text_align_v);