pass font to canvas.print(...)

This commit is contained in:
j3d1 2018-11-02 09:36:41 +01:00
parent 58f3d1f02b
commit 3f3c40a9b1
2 changed files with 19 additions and 14 deletions

View file

@ -14,23 +14,13 @@ private:
const int width_;
const int height_;
public:
canvas(int w, int h);
canvas(int w, int h) : width_(w), height_(h) {
void draw(int x, int y);
}
void draw(int x, int y) {
hal_draw(x, y);
}
void print(int x, int y, const char *str) {
basic_5x4.print(x, y, str, *this);
}
void print(int x, int y, char *str) {
basic_5x4.print(x, y, str, *this);
}
void print(int x, int y, const char *str, font& = basic_5x4);
void print(int x, int y, char *str, font& = basic_5x4);
};

View file

@ -3,3 +3,18 @@
//
#include "gfx/canvas.h"
canvas::canvas(int w, int h) : width_(w), height_(h) {
}
void canvas::draw(int x, int y) {
hal_draw(x, y);
}
void canvas::print(int x, int y, const char *str, font& f) {
f.print(x, y, str, *this);
}
void canvas::print(int x, int y, char *str, font& f) {
f.print(x, y, str, *this);
}