Fixed many issues with text paragraphs in GUI

This commit is contained in:
Yousef Khadadeh 2026-04-25 19:01:19 +03:00
parent 2d039dc47b
commit eb490906a0
13 changed files with 132 additions and 37 deletions

View file

@ -8,7 +8,10 @@ class TextParagraph : public Element {
public:
struct Data {
RichText::TextData text;
float width;
float maxGrowX = 10000.0f;
float maxGrowY = 0.0f;
bool ellipsis = true;
bool allowNewlines = true;
bool operator==(const Data& d) const = default;
bool operator!=(const Data& d) const = default;
};
@ -18,6 +21,7 @@ class TextParagraph : public Element {
virtual void clay_draw(SkCanvas* canvas, UpdateInputData& io, Clay_RenderCommand* command, bool skiaAA) override;
private:
Data d;
float fontSize;
std::unique_ptr<RichText::TextBox> textbox;
};