diff --git a/NEWS.md b/NEWS.md index 434cdc6bf..022d6300d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -20,6 +20,8 @@ - Many checkmarks in menus had the wrong value - Maxima's demos are now available in the menu and context menu - Default the filter search boxes to text search, not regex +- Rescaling affected size calculations for code only with a delay +- Mac Os: way higher stability if multiple windows are open # 23.12.0 diff --git a/src/cells/EditorCell.cpp b/src/cells/EditorCell.cpp index 1394005d0..bcca062ea 100644 --- a/src/cells/EditorCell.cpp +++ b/src/cells/EditorCell.cpp @@ -580,6 +580,10 @@ bool EditorCell::NeedsRecalculation(AFontSize fontSize) const { void EditorCell::Recalculate(AFontSize fontsize) { if(NeedsRecalculation(fontsize)) { + // Needs to be before the StyleText() as it sets m_fontsize_scaled + Cell::Recalculate(fontsize); + // Perhaps we should test if the fons have actually changed here. + FontsChanged(); m_isDirty = false; m_widths.clear(); StyleText(); @@ -603,7 +607,8 @@ void EditorCell::Recalculate(AFontSize fontsize) { m_numberOfLines++; linewidth = textSnippet.GetIndentPixels(); } else { - m_configuration->GetRecalcDC()->GetTextExtent(textSnippet.GetText(), &tokenwidth, &tokenheight); + m_configuration->GetRecalcDC()->GetTextExtent(textSnippet.GetText(), + &tokenwidth, &tokenheight); textSnippet.SetWidth(tokenwidth); linewidth += tokenwidth; width = std::max(width, linewidth); @@ -635,7 +640,6 @@ void EditorCell::Recalculate(AFontSize fontsize) { m_height = std::max(m_height, m_charHeight + 2 * Scale_Px(2)); m_containsChanges = false; - Cell::Recalculate(fontsize); } } @@ -2961,8 +2965,7 @@ void EditorCell::StyleTextCode() { // All spaces except the last one (that could cause a line break) // share the same token if (tokenString.Length() > 1) - m_styledText.push_back( - StyledText(tokenString.Right(tokenString.Length() - 1))); + m_styledText.push_back(StyledText(tokenString.Right(tokenString.Length() - 1))); // Now we push the last space to the list of tokens and remember this // space as the space that potentially serves as the next point to