opcodes: add routine to draw window bg
This commit is contained in:
parent
15fd5e6d59
commit
b5985ac922
1 changed files with 14 additions and 0 deletions
14
opcodes.c
14
opcodes.c
|
@ -13,6 +13,18 @@ void set_handler(Opcode o, Handler h) {
|
||||||
handlers[o] = h;
|
handlers[o] = h;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void window_redraw(Node* self) {
|
||||||
|
short fheight = self->memory->editorState[0]->frame->font->height;
|
||||||
|
|
||||||
|
/* TODO: tagrect's height should be multiplied by the numer of lines in the tag */
|
||||||
|
|
||||||
|
Rectangle tagrect = Rect(0,0,self->memory->img->r.max.x,fheight);
|
||||||
|
Rectangle bodyrect = Rect(0,fheight,self->memory->img->r.max.x,self->memory->img->r.max.y);
|
||||||
|
|
||||||
|
draw(self->memory->img, tagrect, tagcols[BACK], nil, tagrect.min);
|
||||||
|
draw(self->memory->img, bodyrect, textcols[BACK], nil, bodyrect.min);
|
||||||
|
}
|
||||||
|
|
||||||
static void handle_init(void* node, void* data) {
|
static void handle_init(void* node, void* data) {
|
||||||
Node* self = (Node*)node;
|
Node* self = (Node*)node;
|
||||||
|
|
||||||
|
@ -37,6 +49,8 @@ static void handle_init(void* node, void* data) {
|
||||||
frinit(tag->frame, r, f, self->memory->img, tagcols);
|
frinit(tag->frame, r, f, self->memory->img, tagcols);
|
||||||
frinit(body->frame, r2, f, self->memory->img, textcols);
|
frinit(body->frame, r2, f, self->memory->img, textcols);
|
||||||
|
|
||||||
|
window_redraw(self);
|
||||||
|
|
||||||
Rune* rr = testdata;
|
Rune* rr = testdata;
|
||||||
for (char* c = testbytes; *c; c++, rr++) {
|
for (char* c = testbytes; *c; c++, rr++) {
|
||||||
chartorune(rr, c);
|
chartorune(rr, c);
|
||||||
|
|
Loading…
Reference in a new issue