@@ -766,7 +766,9 @@ void FilterGraphEditor::DoNodeForGroupInputs(shared_ptr<FilterGraphGroup> group)
766766
767767 // Set size/position
768768 auto headerfont = m_parent->GetFontPref (" Appearance.Filter Graph.header_font" );
769- auto headerfontsize = headerfont->FontSize * ImGui::GetIO ().FontGlobalScale ;
769+ ImGui::PushFont (headerfont.first , headerfont.second );
770+ auto headerfontsize = ImGui::GetFontSize ();
771+ ImGui::PopFont ();
770772 float headerheight = headerfontsize * 1.5 ;
771773 auto gborder = ax::NodeEditor::GetStyle ().GroupBorderWidth ;
772774 auto gpad = ax::NodeEditor::GetStyle ().NodePadding .x ;
@@ -862,7 +864,9 @@ void FilterGraphEditor::DoNodeForGroupOutputs(shared_ptr<FilterGraphGroup> group
862864
863865 // Set size/position
864866 auto headerfont = m_parent->GetFontPref (" Appearance.Filter Graph.header_font" );
865- auto headerfontsize = headerfont->FontSize * ImGui::GetIO ().FontGlobalScale ;
867+ ImGui::PushFont (headerfont.first , headerfont.second );
868+ auto headerfontsize = ImGui::GetFontSize ();
869+ ImGui::PopFont ();
866870 float headerheight = headerfontsize * 1.5 ;
867871 auto gborder = ax::NodeEditor::GetStyle ().GroupBorderWidth ;
868872 auto gpad = ax::NodeEditor::GetStyle ().NodePadding .x ;
@@ -1865,7 +1869,9 @@ void FilterGraphEditor::DoNodeForTrigger(Trigger* trig)
18651869 auto id = GetID (trig);
18661870 auto headercolor = prefs.GetColor (" Appearance.Filter Graph.header_text_color" );
18671871 auto headerfont = m_parent->GetFontPref (" Appearance.Filter Graph.header_font" );
1868- auto headerfontsize = headerfont->FontSize * ImGui::GetIO ().FontGlobalScale ;
1872+ ImGui::PushFont (headerfont.first , headerfont.second );
1873+ auto headerfontsize = ImGui::GetFontSize ();
1874+ ImGui::PopFont ();
18691875 float headerheight = headerfontsize * 1.5 ;
18701876 float rounding = ax::NodeEditor::GetStyle ().NodeRounding ;
18711877
@@ -1880,7 +1886,7 @@ void FilterGraphEditor::DoNodeForTrigger(Trigger* trig)
18801886 headerText = trig->GetScope ()->m_nickname + " : " + headerText;
18811887
18821888 // Figure out how big the header text is and reserve space for it
1883- auto headerSize = headerfont->CalcTextSizeA (headerfontsize, FLT_MAX, 0 , headerText.c_str ());
1889+ auto headerSize = headerfont. first ->CalcTextSizeA (headerfontsize, FLT_MAX, 0 , headerText.c_str ());
18841890 float nodewidth = max (15 *tsize, headerSize.x );
18851891 ImGui::Dummy (ImVec2 (nodewidth, headerheight));
18861892
@@ -1933,8 +1939,8 @@ void FilterGraphEditor::DoNodeForTrigger(Trigger* trig)
19331939 rounding,
19341940 ImDrawFlags_RoundCornersTop);
19351941 bgList->AddText (
1936- headerfont,
1937- headerfontsize ,
1942+ headerfont. first ,
1943+ headerfont. second ,
19381944 ImVec2 (pos.x + headerfontsize*0.5 , pos.y + headerfontsize*0.25 ),
19391945 headercolor,
19401946 headerText.c_str ());
@@ -1965,9 +1971,13 @@ void FilterGraphEditor::DoNodeForChannel(
19651971 auto color = ColorFromString (displaycolor);
19661972 auto headercolor = prefs.GetColor (" Appearance.Filter Graph.header_text_color" );
19671973 auto headerfont = m_parent->GetFontPref (" Appearance.Filter Graph.header_font" );
1968- auto headerfontsize = headerfont->FontSize * ImGui::GetIO ().FontGlobalScale ;
1974+ ImGui::PushFont (headerfont.first , headerfont.second );
1975+ auto headerfontsize = ImGui::GetFontSize ();
1976+ ImGui::PopFont ();
19691977 auto textfont = m_parent->GetFontPref (" Appearance.Filter Graph.icon_caption_font" );
1970- auto textfontsize = textfont->FontSize * ImGui::GetIO ().FontGlobalScale ;
1978+ ImGui::PushFont (textfont.first , textfont.second );
1979+ auto textfontsize = ImGui::GetFontSize ();
1980+ ImGui::PopFont ();
19711981 float headerheight = headerfontsize * 1.5 ;
19721982 float rounding = ax::NodeEditor::GetStyle ().NodeRounding ;
19731983
@@ -1985,7 +1995,7 @@ void FilterGraphEditor::DoNodeForChannel(
19851995 headerText = inst->m_nickname + " : " + headerText;
19861996
19871997 // Figure out how big the header text is
1988- auto headerSize = headerfont->CalcTextSizeA (headerfontsize, FLT_MAX, 0 , headerText.c_str ());
1998+ auto headerSize = headerfont. first ->CalcTextSizeA (headerfontsize, FLT_MAX, 0 , headerText.c_str ());
19891999
19902000 // Format block type early, even though it's not drawn until later
19912001 // so that we know how much space to allocate
@@ -2011,7 +2021,7 @@ void FilterGraphEditor::DoNodeForChannel(
20112021 blocktype = " Hardware input" ;
20122022 }
20132023 ImVec2 iconsize (ImGui::GetFontSize () * 6 , ImGui::GetFontSize () * 3 );
2014- auto captionsize = textfont->CalcTextSizeA (textfontsize, FLT_MAX, 0 , blocktype.c_str ());
2024+ auto captionsize = textfont. first ->CalcTextSizeA (textfontsize, FLT_MAX, 0 , blocktype.c_str ());
20152025
20162026 // Reserve space for the center icon and node type caption
20172027 float iconwidth = max (iconsize.x , captionsize.x );
@@ -2025,13 +2035,13 @@ void FilterGraphEditor::DoNodeForChannel(
20252035 {
20262036 auto name = string (" ‣ " ) + channel->GetInputName (i);
20272037 inames.push_back (name);
2028- iportmax = max (iportmax, textfont->CalcTextSizeA (textfontsize, FLT_MAX, 0 , name.c_str ()).x );
2038+ iportmax = max (iportmax, textfont. first ->CalcTextSizeA (textfontsize, FLT_MAX, 0 , name.c_str ()).x );
20292039 }
20302040 for (size_t i=0 ; i<channel->GetStreamCount (); i++)
20312041 {
20322042 auto name = channel->GetStreamName (i) + " ‣" ;
20332043 onames.push_back (name);
2034- oportmax = max (oportmax, textfont->CalcTextSizeA (textfontsize, FLT_MAX, 0 , name.c_str ()).x );
2044+ oportmax = max (oportmax, textfont. first ->CalcTextSizeA (textfontsize, FLT_MAX, 0 , name.c_str ()).x );
20352045 }
20362046 float colswidth = iportmax + oportmax + iconwidth;
20372047 float nodewidth = max (colswidth, headerSize.x ) + 3 *ImGui::GetStyle ().ItemSpacing .x ;
@@ -2139,8 +2149,8 @@ void FilterGraphEditor::DoNodeForChannel(
21392149 rounding,
21402150 ImDrawFlags_RoundCornersTop);
21412151 bgList->AddText (
2142- headerfont,
2143- headerfontsize ,
2152+ headerfont. first ,
2153+ headerfont. second ,
21442154 ImVec2 (pos.x + headerfontsize*0.5 , pos.y + headerfontsize*0.25 ),
21452155 headercolor,
21462156 headerText.c_str ());
@@ -2151,7 +2161,7 @@ void FilterGraphEditor::DoNodeForChannel(
21512161 if (runtime > 0 )
21522162 {
21532163 auto runtimeText = fs.PrettyPrint (runtime, 3 );
2154- auto runtimeSize = headerfont->CalcTextSizeA (headerfontsize, FLT_MAX, 0 , runtimeText.c_str ());
2164+ auto runtimeSize = headerfont. first ->CalcTextSizeA (headerfontsize, FLT_MAX, 0 , runtimeText.c_str ());
21552165
21562166 auto timebgColor = ColorFromString (" #404040" );
21572167 auto timeTextColor = ColorFromString (" #ffffff" );
@@ -2181,8 +2191,8 @@ void FilterGraphEditor::DoNodeForChannel(
21812191 clockiconpos + clockiconsize );
21822192
21832193 bgList->AddText (
2184- headerfont,
2185- headerfontsize ,
2194+ headerfont. first ,
2195+ headerfont. second ,
21862196 textpos,
21872197 timeTextColor,
21882198 runtimeText.c_str ());
@@ -2203,8 +2213,8 @@ void FilterGraphEditor::DoNodeForChannel(
22032213 pos + icondelta +
22042214 ImVec2 (0 , iconsize.y + ImGui::GetStyle ().ItemSpacing .y *3 );
22052215 bgList->AddText (
2206- textfont,
2207- textfontsize ,
2216+ textfont. first ,
2217+ textfont. second ,
22082218 textpos + ImVec2 ( (iconwidth - captionsize.x )/2 , 0 ),
22092219 textColor,
22102220 blocktype.c_str ());
0 commit comments