@@ -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