Skip to content

Commit cb1468a

Browse files
Found the rescaling-issue for #1802
1 parent 215bdc0 commit cb1468a

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
- Many checkmarks in menus had the wrong value
2121
- Maxima's demos are now available in the menu and context menu
2222
- Default the filter search boxes to text search, not regex
23+
- Rescaling affected size calculations for code only with a delay
24+
- Mac Os: way higher stability if multiple windows are open
2325

2426
# 23.12.0
2527

src/cells/EditorCell.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,10 @@ bool EditorCell::NeedsRecalculation(AFontSize fontSize) const {
580580
void EditorCell::Recalculate(AFontSize fontsize) {
581581
if(NeedsRecalculation(fontsize))
582582
{
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();
583587
m_isDirty = false;
584588
m_widths.clear();
585589
StyleText();
@@ -603,7 +607,8 @@ void EditorCell::Recalculate(AFontSize fontsize) {
603607
m_numberOfLines++;
604608
linewidth = textSnippet.GetIndentPixels();
605609
} else {
606-
m_configuration->GetRecalcDC()->GetTextExtent(textSnippet.GetText(), &tokenwidth, &tokenheight);
610+
m_configuration->GetRecalcDC()->GetTextExtent(textSnippet.GetText(),
611+
&tokenwidth, &tokenheight);
607612
textSnippet.SetWidth(tokenwidth);
608613
linewidth += tokenwidth;
609614
width = std::max(width, linewidth);
@@ -635,7 +640,6 @@ void EditorCell::Recalculate(AFontSize fontsize) {
635640
m_height = std::max(m_height, m_charHeight + 2 * Scale_Px(2));
636641

637642
m_containsChanges = false;
638-
Cell::Recalculate(fontsize);
639643
}
640644
}
641645

@@ -2961,8 +2965,7 @@ void EditorCell::StyleTextCode() {
29612965
// All spaces except the last one (that could cause a line break)
29622966
// share the same token
29632967
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)));
29662969

29672970
// Now we push the last space to the list of tokens and remember this
29682971
// space as the space that potentially serves as the next point to

0 commit comments

Comments
 (0)