mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 14:47:37 +03:00
Compare commits
2 Commits
95cf1dcfc3
...
08ed16e264
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
08ed16e264 | ||
|
|
47c75658e9 |
@ -79,11 +79,10 @@ void SleepActivity::onEnter() {
|
|||||||
void SleepActivity::renderPopup(const char* message) const {
|
void SleepActivity::renderPopup(const char* message) const {
|
||||||
const int textWidth = renderer.getTextWidth(READER_FONT_ID, message);
|
const int textWidth = renderer.getTextWidth(READER_FONT_ID, message);
|
||||||
constexpr int margin = 20;
|
constexpr int margin = 20;
|
||||||
// Round all coordinates to 8 pixel boundaries
|
const int x = (GfxRenderer::getScreenWidth() - textWidth - margin * 2) / 2;
|
||||||
const int x = ((GfxRenderer::getScreenWidth() - textWidth - margin * 2) / 2 + 7) / 8 * 8;
|
constexpr int y = 117;
|
||||||
constexpr int y = 56;
|
const int w = textWidth + margin * 2;
|
||||||
const int w = (textWidth + margin * 2 + 7) / 8 * 8;
|
const int h = renderer.getLineHeight(READER_FONT_ID) + margin * 2;
|
||||||
const int h = (renderer.getLineHeight(READER_FONT_ID) + margin * 2 + 7) / 8 * 8;
|
|
||||||
// renderer.clearScreen();
|
// renderer.clearScreen();
|
||||||
renderer.fillRect(x + 5, y + 5, w - 10, h - 10, false);
|
renderer.fillRect(x + 5, y + 5, w - 10, h - 10, false);
|
||||||
renderer.drawText(READER_FONT_ID, x + margin, y + margin, message);
|
renderer.drawText(READER_FONT_ID, x + margin, y + margin, message);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user