mirror of https://gitlab.com/nakst/essence
ui: fix text display plan caching bug
This commit is contained in:
parent
10a7d4f1d1
commit
68649f9260
|
@ -4038,6 +4038,11 @@ EsCanvasPane *EsCanvasPaneCreate(EsElement *parent, uint64_t flags, EsStyleID st
|
||||||
// TODO Inline backgrounds.
|
// TODO Inline backgrounds.
|
||||||
|
|
||||||
void TextDisplayFreeRuns(EsTextDisplay *display) {
|
void TextDisplayFreeRuns(EsTextDisplay *display) {
|
||||||
|
if (display->plan) {
|
||||||
|
EsTextPlanDestroy(display->plan);
|
||||||
|
display->plan = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
if (display->usingSyntaxHighlighting) {
|
if (display->usingSyntaxHighlighting) {
|
||||||
Array<EsTextRun> textRuns = { display->textRuns };
|
Array<EsTextRun> textRuns = { display->textRuns };
|
||||||
textRuns.Free();
|
textRuns.Free();
|
||||||
|
@ -4097,10 +4102,6 @@ int ProcessTextDisplayMessage(EsElement *element, EsMessage *message) {
|
||||||
display->measurementCache.Store(message);
|
display->measurementCache.Store(message);
|
||||||
}
|
}
|
||||||
} else if (message->type == ES_MSG_DESTROY) {
|
} else if (message->type == ES_MSG_DESTROY) {
|
||||||
if (display->plan) {
|
|
||||||
EsTextPlanDestroy(display->plan);
|
|
||||||
}
|
|
||||||
|
|
||||||
TextDisplayFreeRuns(display);
|
TextDisplayFreeRuns(display);
|
||||||
EsHeapFree(display->contents);
|
EsHeapFree(display->contents);
|
||||||
} else if (message->type == ES_MSG_GET_INSPECTOR_INFORMATION) {
|
} else if (message->type == ES_MSG_GET_INSPECTOR_INFORMATION) {
|
||||||
|
|
|
@ -113,7 +113,7 @@ void GenerateAPISamples() {
|
||||||
if section == "[build]" && StringStartsWith(line, "source=") config[i] = "source=" + sourceFile;
|
if section == "[build]" && StringStartsWith(line, "source=") config[i] = "source=" + sourceFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileWriteAll(folder + "make.build_core", StringJoin(config, "\n", false));
|
assert FileWriteAll(folder + "make.build_core", StringJoin(config, "\n", false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue