fixed build without image support

This commit is contained in:
thrust26 2023-09-14 19:37:27 +02:00
parent c6e72beeff
commit 6f7c96aef1
2 changed files with 11 additions and 8 deletions

View File

@ -559,17 +559,20 @@ void RomImageWidget::drawWidget(bool hilite)
return; return;
} }
#ifdef IMAGE_SUPPORT
if(mySurfaceIsValid) if(mySurfaceIsValid)
{ {
s.fillRect(_x, _y, _w, myImageHeight, 0); s.fillRect(_x, _y, _w, myImageHeight, 0);
positionSurfaces(); positionSurfaces();
} }
else if(!mySurfaceErrorMsg.empty()) else
{ #endif
const uInt32 x = _x + ((_w - _font.getStringWidth(mySurfaceErrorMsg)) >> 1); if(!mySurfaceErrorMsg.empty())
const uInt32 y = _y + ((myImageHeight - _font.getLineHeight()) >> 1); {
s.drawString(_font, mySurfaceErrorMsg, x, y, _w - 10, _textcolor); const uInt32 x = _x + ((_w - _font.getStringWidth(mySurfaceErrorMsg)) >> 1);
} const uInt32 y = _y + ((myImageHeight - _font.getLineHeight()) >> 1);
s.drawString(_font, mySurfaceErrorMsg, x, y, _w - 10, _textcolor);
}
// Draw the image label and counter // Draw the image label and counter
ostringstream buf; ostringstream buf;

View File

@ -47,12 +47,12 @@ class RomImageWidget : public Widget
uInt64 pendingLoadTime() { return myMaxLoadTime * timeFactor; } uInt64 pendingLoadTime() { return myMaxLoadTime * timeFactor; }
protected: protected:
#ifdef IMAGE_SUPPORT #ifdef IMAGE_SUPPORT
bool handleEvent(Event::Type event) override; bool handleEvent(Event::Type event) override;
void handleMouseUp(int x, int y, MouseButton b, int clickCount) override; void handleMouseUp(int x, int y, MouseButton b, int clickCount) override;
void handleMouseMoved(int x, int y) override; void handleMouseMoved(int x, int y) override;
void tick() override; void tick() override;
#endif #endif
void drawWidget(bool hilite) override; void drawWidget(bool hilite) override;
private: private: