Mirror upstream PR#1817

This commit is contained in:
jpirnay
2026-05-04 16:52:54 +02:00
parent 7a0dc31c2f
commit 47946def00
+5 -10
View File
@@ -7,8 +7,11 @@
#include <Utf8.h>
#include <esp_heap_caps.h>
#include <algorithm>
#include "FontCacheManager.h"
const uint8_t* GfxRenderer::getGlyphBitmap(const EpdFontData* fontData, const EpdGlyph* glyph) const {
if (fontData->groups != nullptr) {
auto* fd = fontCacheManager_ ? fontCacheManager_->getDecompressor() : nullptr;
@@ -1696,16 +1699,8 @@ void GfxRenderer::fillPolygon(const int* xPoints, const int* yPoints, int numPoi
j = i;
}
// Sort nodes by X (simple bubble sort, numPoints is small)
for (int i = 0; i < nodes - 1; i++) {
for (int k = i + 1; k < nodes; k++) {
if (nodeX[i] > nodeX[k]) {
int temp = nodeX[i];
nodeX[i] = nodeX[k];
nodeX[k] = temp;
}
}
}
// Sort nodes by X
std::sort(nodeX, nodeX + nodes);
// Fill between pairs of nodes
for (int i = 0; i < nodes - 1; i += 2) {