@@ -580,6 +580,10 @@ bool EditorCell::NeedsRecalculation(AFontSize fontSize) const {
580
580
void EditorCell::Recalculate (AFontSize fontsize) {
581
581
if (NeedsRecalculation (fontsize))
582
582
{
583
+ // Needs to be before the StyleText() as it sets m_fontsize_scaled
584
+ Cell::Recalculate (fontsize);
585
+ // Perhaps we should test if the fons have actually changed here.
586
+ FontsChanged ();
583
587
m_isDirty = false ;
584
588
m_widths.clear ();
585
589
StyleText ();
@@ -603,7 +607,8 @@ void EditorCell::Recalculate(AFontSize fontsize) {
603
607
m_numberOfLines++;
604
608
linewidth = textSnippet.GetIndentPixels ();
605
609
} else {
606
- m_configuration->GetRecalcDC ()->GetTextExtent (textSnippet.GetText (), &tokenwidth, &tokenheight);
610
+ m_configuration->GetRecalcDC ()->GetTextExtent (textSnippet.GetText (),
611
+ &tokenwidth, &tokenheight);
607
612
textSnippet.SetWidth (tokenwidth);
608
613
linewidth += tokenwidth;
609
614
width = std::max (width, linewidth);
@@ -635,7 +640,6 @@ void EditorCell::Recalculate(AFontSize fontsize) {
635
640
m_height = std::max (m_height, m_charHeight + 2 * Scale_Px (2 ));
636
641
637
642
m_containsChanges = false ;
638
- Cell::Recalculate (fontsize);
639
643
}
640
644
}
641
645
@@ -2961,8 +2965,7 @@ void EditorCell::StyleTextCode() {
2961
2965
// All spaces except the last one (that could cause a line break)
2962
2966
// share the same token
2963
2967
if (tokenString.Length () > 1 )
2964
- m_styledText.push_back (
2965
- StyledText (tokenString.Right (tokenString.Length () - 1 )));
2968
+ m_styledText.push_back (StyledText (tokenString.Right (tokenString.Length () - 1 )));
2966
2969
2967
2970
// Now we push the last space to the list of tokens and remember this
2968
2971
// space as the space that potentially serves as the next point to
0 commit comments