Mirror upstream PR#1817
This commit is contained in:
@@ -7,8 +7,11 @@
|
|||||||
#include <Utf8.h>
|
#include <Utf8.h>
|
||||||
#include <esp_heap_caps.h>
|
#include <esp_heap_caps.h>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#include "FontCacheManager.h"
|
#include "FontCacheManager.h"
|
||||||
|
|
||||||
|
|
||||||
const uint8_t* GfxRenderer::getGlyphBitmap(const EpdFontData* fontData, const EpdGlyph* glyph) const {
|
const uint8_t* GfxRenderer::getGlyphBitmap(const EpdFontData* fontData, const EpdGlyph* glyph) const {
|
||||||
if (fontData->groups != nullptr) {
|
if (fontData->groups != nullptr) {
|
||||||
auto* fd = fontCacheManager_ ? fontCacheManager_->getDecompressor() : nullptr;
|
auto* fd = fontCacheManager_ ? fontCacheManager_->getDecompressor() : nullptr;
|
||||||
@@ -1696,16 +1699,8 @@ void GfxRenderer::fillPolygon(const int* xPoints, const int* yPoints, int numPoi
|
|||||||
j = i;
|
j = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort nodes by X (simple bubble sort, numPoints is small)
|
// Sort nodes by X
|
||||||
for (int i = 0; i < nodes - 1; i++) {
|
std::sort(nodeX, nodeX + nodes);
|
||||||
for (int k = i + 1; k < nodes; k++) {
|
|
||||||
if (nodeX[i] > nodeX[k]) {
|
|
||||||
int temp = nodeX[i];
|
|
||||||
nodeX[i] = nodeX[k];
|
|
||||||
nodeX[k] = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fill between pairs of nodes
|
// Fill between pairs of nodes
|
||||||
for (int i = 0; i < nodes - 1; i += 2) {
|
for (int i = 0; i < nodes - 1; i += 2) {
|
||||||
|
|||||||
Reference in New Issue
Block a user