diff --git a/opcodes.c b/opcodes.c index 7530f9a..edcdda9 100644 --- a/opcodes.c +++ b/opcodes.c @@ -13,6 +13,18 @@ void set_handler(Opcode o, Handler 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) { 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(body->frame, r2, f, self->memory->img, textcols); + window_redraw(self); + Rune* rr = testdata; for (char* c = testbytes; *c; c++, rr++) { chartorune(rr, c);