Skip to content

Commit 6adeeab

Browse files
committed
ready for 3.0 release - small fix
1 parent b8a9770 commit 6adeeab

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

examples/esp/esp32SimHub/esp32SimHub.emf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@
332332
},
333333
{
334334
"name": "DISPLAY_BUFFER_SIZE",
335-
"latestValue": "20",
335+
"latestValue": "40",
336336
"subsystem": "DISPLAY"
337337
},
338338
{

examples/esp/esp32SimHub/esp32SimHub_menu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const PROGMEM ConnectorLocalInfo applicationInfo = { "SimHub Link", "4db9fbfe-9
1919
TcMenuRemoteServer remoteServer(applicationInfo);
2020

2121
Adafruit_ILI9341 gfx(22, 17, 16);
22-
AdafruitDrawable gfxDrawable(&gfx, 20);
22+
AdafruitDrawable gfxDrawable(&gfx, 40);
2323
GraphicsDeviceRenderer renderer(30, applicationInfo.name, &gfxDrawable);
2424
ESP32TouchKeysAbstraction esp32Touch(800, TOUCH_HVOLT_2V7, TOUCH_LVOLT_0V5, TOUCH_HVOLT_ATTEN_1V);
2525
SimHubRemoteConnection simhubConnection(&Serial, 3);

src/graphics/GraphicsDeviceRenderer.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ namespace tcgfx {
1212
static unsigned char rendererUpArrowXbm[] = { 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0x3f, 0x1f, 0x0f, 0x07, 0x03 };
1313
static unsigned char rendererDownArrowXbm[] = { 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0 };
1414

15+
inline bool isActiveOrEditing(MenuItem* pItem) {
16+
auto mt = pItem->getMenuType();
17+
return (pItem->isEditing() || pItem->isActive()) && mt != MENUTYPE_TITLE_ITEM && mt != MENUTYPE_BACK_VALUE;
18+
}
19+
1520
GraphicsDeviceRenderer::GraphicsDeviceRenderer(int bufferSize, const char *appTitle, DeviceDrawable *drawable)
1621
: BaseGraphicalRenderer(bufferSize, 1, 1, false, appTitle), rootDrawable(drawable), drawable(drawable) {
1722
const Coord &coord = rootDrawable->getDisplayDimensions();
@@ -73,7 +78,7 @@ namespace tcgfx {
7378
subDevice = rootDrawable->getSubDeviceFor(where, areaSize, entry->getDisplayProperties()->getPalette(), 6);
7479
} else if(rootDrawable->getSubDeviceType() == DeviceDrawable::SUB_DEVICE_2BPP) {
7580
color_t palette[4];
76-
bool selected = entry->getMenuItem()->isActive() || entry->getMenuItem()->isEditing();
81+
bool selected = isActiveOrEditing(entry->getMenuItem());
7782
palette[ItemDisplayProperties::TEXT] = (selected) ? propertiesFactory.getSelectedColor(ItemDisplayProperties::TEXT) : entry->getDisplayProperties()->getPalette()[ItemDisplayProperties::TEXT];
7883
palette[ItemDisplayProperties::BACKGROUND] = (selected) ? propertiesFactory.getSelectedColor(ItemDisplayProperties::BACKGROUND) : entry->getDisplayProperties()->getPalette()[ItemDisplayProperties::BACKGROUND];
7984
palette[ItemDisplayProperties::HIGHLIGHT1] = entry->getDisplayProperties()->getPalette()[ItemDisplayProperties::HIGHLIGHT1];
@@ -108,11 +113,6 @@ namespace tcgfx {
108113
}
109114
}
110115

111-
inline bool isActiveOrEditing(MenuItem* pItem) {
112-
auto mt = pItem->getMenuType();
113-
return (pItem->isEditing() || pItem->isActive()) && mt != MENUTYPE_TITLE_ITEM && mt != MENUTYPE_BACK_VALUE;
114-
}
115-
116116
int GraphicsDeviceRenderer::calculateSpaceBetween(const void* font, uint8_t mag, const char* buffer, int start, int end) {
117117
int bufferLen = (int)strlen(buffer);
118118
int pos = start;

0 commit comments

Comments
 (0)