julia: render at least once so we don't flash black when panning

This commit is contained in:
K. Lange 2023-05-07 09:24:21 +09:00
parent 670dc652e5
commit 70d594f75e

View File

@ -234,7 +234,6 @@ void usage(char * argv[]) {
static void decors() { static void decors() {
render_decorations(window, ctx, app_name); render_decorations(window, ctx, app_name);
flip(ctx);
} }
static void do_line(gfx_context_t * ctx, int j) { static void do_line(gfx_context_t * ctx, int j) {
@ -253,6 +252,8 @@ static int processing = 0;
static clock_t time_before; static clock_t time_before;
#define START_POINT -4 #define START_POINT -4
void step_once(void);
void start_processing(void) { void start_processing(void) {
double _x = Maxx - Minx; double _x = Maxx - Minx;
double _y = _x / width * height; double _y = _x / width * height;
@ -272,9 +273,9 @@ void start_processing(void) {
draw_fill(ctx, rgb(0,0,0)); draw_fill(ctx, rgb(0,0,0));
decors(); decors();
yutani_flip(yctx, window);
time_before = clock(); time_before = clock();
step_once();
} }
void draw_label(void) { void draw_label(void) {
@ -321,6 +322,7 @@ void step_once(void) {
if (step_n < 0 && step_y > height) { if (step_n < 0 && step_y > height) {
flip(ctx); flip(ctx);
yutani_flip(yctx, window); yutani_flip(yctx, window);
step_res /= 2; step_res /= 2;
step_y = 0; step_y = 0;
step_i = 0; step_i = 0;
@ -349,7 +351,6 @@ void step_once(void) {
} }
} }
step_i += 1; step_i += 1;
step_y += step_res; step_y += step_res;
} else if (step_n % 2) { } else if (step_n % 2) {
@ -507,6 +508,7 @@ int main(int argc, char * argv[]) {
if (menu_process_event(yctx, m)) { if (menu_process_event(yctx, m)) {
/* just decorations should be fine */ /* just decorations should be fine */
decors(); decors();
flip(ctx);
yutani_flip(yctx, window); yutani_flip(yctx, window);
} }
switch (m->type) { switch (m->type) {
@ -594,6 +596,7 @@ int main(int argc, char * argv[]) {
if (win && win == window) { if (win && win == window) {
win->focused = wf->focused; win->focused = wf->focused;
decors(); decors();
flip(ctx);
yutani_flip(yctx, window); yutani_flip(yctx, window);
} }
} }