GRAPHICS: MACGUI: Encapsulate text details in MacTextCanvas

This commit is contained in:
Eugene Sandulenko 2023-10-05 23:32:36 +02:00
parent e7e18b79f7
commit 382a1acfa7
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
2 changed files with 261 additions and 259 deletions

File diff suppressed because it is too large Load Diff

View File

@ -119,15 +119,16 @@ struct MacFontRun {
struct MacTextLine;
struct MacTextTableCell {
struct MacTextCanvas {
Common::Array<MacTextLine> text;
uint16 flags = 0;
ManagedSurface surf;
ManagedSurface *surface = nullptr, *shadowSurface = nullptr;
int textWidth = -1;
int textMaxHeigh = 0;
};
struct MacTextTableRow {
Common::Array<MacTextTableCell> cells;
Common::Array<MacTextCanvas> cells;
int heght = -1;
};
@ -273,7 +274,7 @@ public:
void appendTextDefault(const Common::String &str, bool skipAdd = false);
void clearText();
void removeLastLine();
int getLineCount() { return _textLines.size(); }
int getLineCount() { return _canvas.text.size(); }
int getLineCharWidth(int line, bool enforce = false);
int getLastLineWidth();
int getTextHeight() { return _textMaxHeight; }
@ -399,7 +400,8 @@ protected:
TextAlign _textAlignment;
Common::Array<MacTextLine> _textLines;
MacTextCanvas _canvas;
MacFontRun _defaultFormatting;
MacFontRun _currentFormatting;