wxMaxima
Loading...
Searching...
No Matches
Functions
Cell.cpp File Reference

Core layout and rendering logic for worksheet cells. More...

#include "Cell.h"
#include "CellList.h"
#include "GroupCell.h"
#include "TextCell.h"
#include "VisiblyInvalidCell.h"
#include "../Worksheet.h"
#include <algorithm>
#include <utility>
#include <wx/regex.h>
#include <wx/sstream.h>
#include <wx/xml/xml.h>
#include "SvgBitmap.h"
Include dependency graph for Cell.cpp:

Functions

std::ostream & operator<< (std::ostream &out, const CellType celltype)
 Allow Standard c++ streams to print out our enum values as text.
 

Detailed Description

Core layout and rendering logic for worksheet cells.

The 3-Pass Layout Pipeline

To ensure consistent cell positioning and resolve issues with complex mathematical layouts (fractions, exponents, etc.) and line-breaking, wxMaxima uses a strict three-pass system:

Pass 1: Measure (Recalculate)

In this pass, each cell determines its intrinsic size (width, height, and baseline center). This pass is recursive and handles the "BreakUp" (linearization) of wide 2D objects into their 1D forms.

See also
Recalculate()

Pass 2: Arrange (SetCurrentPoint)

Once sizes are known, this pass recursively calculates and assigns absolute worksheet coordinates (m_currentPoint) to every cell in the hierarchy. This is the single source of truth for positioning.

See also
SetCurrentPoint()

Pass 3: Paint (Draw)

This is a fast, rendering-only pass. It simply draws the cell content using the coordinates pre-calculated in Pass 2. It performs no layout logic itself.

See also
Draw()