@@ -739,9 +739,8 @@ void FilterGraphEditor::DoNodeForGroupInputs(shared_ptr<FilterGraphGroup> group)
739739 auto gpos = ax::NodeEditor::GetNodePosition (gid);
740740
741741 // Figure out how big the port text is
742- auto textfont = ImGui::GetFont ();
743742 float oportmax = 1 ;
744- float iportmax = textfont-> CalcTextSizeA ( ImGui::GetFontSize (), FLT_MAX, 0 , " ‣" ).x ;
743+ float iportmax = ImGui::CalcTextSize ( " ‣" ).x ;
745744 vector<string> onames;
746745 for (auto it : group->m_hierInputMap )
747746 {
@@ -759,7 +758,7 @@ void FilterGraphEditor::DoNodeForGroupInputs(shared_ptr<FilterGraphGroup> group)
759758 auto name = sinkname + " ‣" ;
760759 onames.push_back (name);
761760 oportmax = max (oportmax,
762- textfont-> CalcTextSizeA ( ImGui::GetFontSize (), FLT_MAX, 0 , name.c_str ()).x +
761+ ImGui::CalcTextSize ( name.c_str ()).x +
763762 ImGui::GetFontSize () * 2 );
764763 }
765764 float nodewidth = oportmax + iportmax + 1 *ImGui::GetStyle ().ItemSpacing .x ;
@@ -848,17 +847,16 @@ void FilterGraphEditor::DoNodeForGroupOutputs(shared_ptr<FilterGraphGroup> group
848847 auto gsz = ax::NodeEditor::GetNodeSize (gid);
849848
850849 // Figure out how big the port text is
851- auto textfont = ImGui::GetFont ();
852850 float oportmax = 1 ;
853- float iportmax = textfont-> CalcTextSizeA ( ImGui::GetFontSize (), FLT_MAX, 0 , " ‣" ).x ;
851+ float iportmax = ImGui::CalcTextSize ( " ‣" ).x ;
854852 vector<string> onames;
855853 for (auto it : group->m_hierOutputMap )
856854 {
857855 auto stream = it.first ;
858856
859857 auto name = stream.GetName () + " ‣" ;
860858 onames.push_back (name);
861- oportmax = max (oportmax, textfont-> CalcTextSizeA ( ImGui::GetFontSize (), FLT_MAX, 0 , name.c_str ()).x );
859+ oportmax = max (oportmax, ImGui::CalcTextSize ( name.c_str ()).x );
862860 }
863861 float nodewidth = oportmax + iportmax + 3 *ImGui::GetStyle ().ItemSpacing .x ;
864862
@@ -1886,7 +1884,7 @@ void FilterGraphEditor::DoNodeForTrigger(Trigger* trig)
18861884 headerText = trig->GetScope ()->m_nickname + " : " + headerText;
18871885
18881886 // Figure out how big the header text is and reserve space for it
1889- auto headerSize = headerfont. first -> CalcTextSizeA (headerfontsize, FLT_MAX, 0 , headerText.c_str ());
1887+ auto headerSize = CalcTextSizeForFont (headerfont , headerText.c_str ());
18901888 float nodewidth = max (15 *tsize, headerSize.x );
18911889 ImGui::Dummy (ImVec2 (nodewidth, headerheight));
18921890
@@ -1995,7 +1993,7 @@ void FilterGraphEditor::DoNodeForChannel(
19951993 headerText = inst->m_nickname + " : " + headerText;
19961994
19971995 // Figure out how big the header text is
1998- auto headerSize = headerfont. first -> CalcTextSizeA (headerfontsize, FLT_MAX, 0 , headerText.c_str ());
1996+ auto headerSize = CalcTextSizeForFont (headerfont , headerText.c_str ());
19991997
20001998 // Format block type early, even though it's not drawn until later
20011999 // so that we know how much space to allocate
@@ -2021,7 +2019,7 @@ void FilterGraphEditor::DoNodeForChannel(
20212019 blocktype = " Hardware input" ;
20222020 }
20232021 ImVec2 iconsize (ImGui::GetFontSize () * 6 , ImGui::GetFontSize () * 3 );
2024- auto captionsize = textfont. first -> CalcTextSizeA (textfontsize, FLT_MAX, 0 , blocktype.c_str ());
2022+ auto captionsize = CalcTextSizeForFont (textfont , blocktype.c_str ());
20252023
20262024 // Reserve space for the center icon and node type caption
20272025 float iconwidth = max (iconsize.x , captionsize.x );
@@ -2035,13 +2033,13 @@ void FilterGraphEditor::DoNodeForChannel(
20352033 {
20362034 auto name = string (" ‣ " ) + channel->GetInputName (i);
20372035 inames.push_back (name);
2038- iportmax = max (iportmax, textfont. first -> CalcTextSizeA (textfontsize, FLT_MAX, 0 , name.c_str ()).x );
2036+ iportmax = max (iportmax, CalcTextSizeForFont (textfont , name.c_str ()).x );
20392037 }
20402038 for (size_t i=0 ; i<channel->GetStreamCount (); i++)
20412039 {
20422040 auto name = channel->GetStreamName (i) + " ‣" ;
20432041 onames.push_back (name);
2044- oportmax = max (oportmax, textfont. first -> CalcTextSizeA (textfontsize, FLT_MAX, 0 , name.c_str ()).x );
2042+ oportmax = max (oportmax, CalcTextSizeForFont (textfont , name.c_str ()).x );
20452043 }
20462044 float colswidth = iportmax + oportmax + iconwidth;
20472045 float nodewidth = max (colswidth, headerSize.x ) + 3 *ImGui::GetStyle ().ItemSpacing .x ;
@@ -2161,7 +2159,7 @@ void FilterGraphEditor::DoNodeForChannel(
21612159 if (runtime > 0 )
21622160 {
21632161 auto runtimeText = fs.PrettyPrint (runtime, 3 );
2164- auto runtimeSize = headerfont. first -> CalcTextSizeA (headerfontsize, FLT_MAX, 0 , runtimeText.c_str ());
2162+ auto runtimeSize = CalcTextSizeForFont (headerfont , runtimeText.c_str ());
21652163
21662164 auto timebgColor = ColorFromString (" #404040" );
21672165 auto timeTextColor = ColorFromString (" #ffffff" );
0 commit comments