mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-12-10 05:30:42 -05:00
Hide ui::Point implementation.
This commit is contained in:
parent
606c1cebac
commit
aac2d31548
11 changed files with 78 additions and 57 deletions
|
|
@ -39,7 +39,7 @@ Style Style::invert() const {
|
|||
int Painter::draw_char(const Point p, const Style& style, const char c) {
|
||||
const auto glyph = style.font.glyph(c);
|
||||
display.draw_glyph(p, glyph, style.foreground, style.background);
|
||||
return glyph.advance().x;
|
||||
return glyph.advance().x();
|
||||
}
|
||||
|
||||
int Painter::draw_string(Point p, const Style& style, const std::string text) {
|
||||
|
|
@ -49,7 +49,7 @@ int Painter::draw_string(Point p, const Style& style, const std::string text) {
|
|||
display.draw_glyph(p, glyph, style.foreground, style.background);
|
||||
const auto advance = glyph.advance();
|
||||
p += advance;
|
||||
width += advance.x;
|
||||
width += advance.x();
|
||||
}
|
||||
return width;
|
||||
}
|
||||
|
|
@ -68,9 +68,9 @@ void Painter::draw_vline(Point p, int height, const Color c) {
|
|||
|
||||
void Painter::draw_rectangle(const Rect r, const Color c) {
|
||||
draw_hline(r.pos, r.size.w, c);
|
||||
draw_vline({ r.pos.x, r.pos.y + 1 }, r.size.h - 2, c);
|
||||
draw_vline({ r.pos.x + r.size.w - 1, r.pos.y + 1 }, r.size.h - 2, c);
|
||||
draw_hline({ r.pos.x, r.pos.y + r.size.h - 1 }, r.size.w, c);
|
||||
draw_vline({ r.pos.x(), r.pos.y() + 1 }, r.size.h - 2, c);
|
||||
draw_vline({ r.pos.x() + r.size.w - 1, r.pos.y() + 1 }, r.size.h - 2, c);
|
||||
draw_hline({ r.pos.x(), r.pos.y() + r.size.h - 1 }, r.size.w, c);
|
||||
}
|
||||
|
||||
void Painter::fill_rectangle(const Rect r, const Color c) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue