Add correct fonts
This commit is contained in:
@@ -13,6 +13,7 @@ target_link_libraries(DisplayGraphics
|
||||
Helpers::All
|
||||
Display::UI::Text
|
||||
Display::UI::HostBlock
|
||||
Display::UI::Header
|
||||
)
|
||||
|
||||
target_include_directories(DisplayGraphics
|
||||
|
||||
@@ -12,6 +12,8 @@ namespace Display::Graphics
|
||||
{
|
||||
framebuffer.clear(Color{0, 0, 0});
|
||||
|
||||
header.draw(framebuffer, textRenderer, START_X, START_Y);
|
||||
|
||||
int blocksPerRow =
|
||||
(SCREEN_WIDTH + BLOCK_GAP) / (Display::UI::HostBlock::BLOCK_WIDTH + BLOCK_GAP);
|
||||
if (blocksPerRow < 1)
|
||||
@@ -25,7 +27,7 @@ namespace Display::Graphics
|
||||
int row = index / blocksPerRow;
|
||||
|
||||
int x = START_X + col * (Display::UI::HostBlock::BLOCK_WIDTH + BLOCK_GAP);
|
||||
int y = START_Y + row * (Display::UI::HostBlock::BLOCK_HEIGHT + BLOCK_GAP);
|
||||
int y = START_Y + header.height() + BLOCK_GAP + row * (Display::UI::HostBlock::BLOCK_HEIGHT + BLOCK_GAP);
|
||||
|
||||
hostblock.draw(
|
||||
framebuffer,
|
||||
|
||||
@@ -2,15 +2,16 @@
|
||||
#include "Display/Graphics/Framebuffer.h"
|
||||
#include "Model/HostRegistry.h"
|
||||
#include "Display/UI/Text/Renderer.h"
|
||||
#include "Display/UI/Header/Header.h"
|
||||
#include "Display/UI/HostBlock/HostBlock.h"
|
||||
#include "Display/Graphics/Color.h"
|
||||
#include <string>
|
||||
|
||||
namespace Display::Graphics
|
||||
{
|
||||
static constexpr int START_X = 0;
|
||||
static constexpr int START_Y = 10;
|
||||
static constexpr int BLOCK_GAP = 4;
|
||||
static constexpr int START_X = 0; // 0
|
||||
static constexpr int START_Y = 0; // 20
|
||||
static constexpr int BLOCK_GAP = 4; // 4
|
||||
|
||||
static constexpr int SCREEN_WIDTH = 240;
|
||||
|
||||
@@ -28,6 +29,7 @@ namespace Display::Graphics
|
||||
Framebuffer &framebuffer;
|
||||
Model::HostRegistry ®istry;
|
||||
Display::UI::Text::Renderer textRenderer;
|
||||
Display::UI::Header::Header header;
|
||||
Display::UI::HostBlock::HostBlock hostblock;
|
||||
};
|
||||
} // namespace Display::Graphics
|
||||
|
||||
Reference in New Issue
Block a user