Starting work on moving GUI to event system (doesnt compile)
This commit is contained in:
parent
f1a855edc3
commit
ef7dfcef05
69 changed files with 4296 additions and 3709 deletions
|
|
@ -4,7 +4,10 @@
|
|||
|
||||
namespace GUIStuff {
|
||||
|
||||
void TextParagraph::update(UpdateInputData& io, std::unique_ptr<skia::textlayout::Paragraph> paragraph, float width, const std::function<void()>& elemUpdate) {
|
||||
TextParagraph::TextParagraph(GUIManager& gui):
|
||||
Element(gui) {}
|
||||
|
||||
void TextParagraph::layout(std::unique_ptr<skia::textlayout::Paragraph> paragraph, float width) {
|
||||
data = std::move(paragraph);
|
||||
data->layout(width);
|
||||
CLAY_AUTO_ID({
|
||||
|
|
@ -12,17 +15,14 @@ void TextParagraph::update(UpdateInputData& io, std::unique_ptr<skia::textlayout
|
|||
.sizing = {.width = CLAY_SIZING_FIXED(width), .height = CLAY_SIZING_FIXED(data->getHeight())}
|
||||
},
|
||||
.custom = { .customData = this }
|
||||
}) {
|
||||
if(elemUpdate)
|
||||
elemUpdate();
|
||||
}
|
||||
}) {}
|
||||
}
|
||||
|
||||
void TextParagraph::clay_draw(SkCanvas* canvas, UpdateInputData& io, Clay_RenderCommand* command, bool skiaAA) {
|
||||
bb = get_bb(command);
|
||||
|
||||
if(data)
|
||||
if(data) {
|
||||
auto& bb = boundingBox.value();
|
||||
data->paint(canvas, bb.min.x(), bb.min.y());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue