layout->height = widget->allocation.height;
x_size = layout->width;
- if (x_size > layout->height * BOARD_X_SIZE / BOARD_Y_SIZE)
- x_size = layout->height * BOARD_X_SIZE / BOARD_Y_SIZE;
+ if (x_size > layout->height * BOARD_X_SIZE / (1 + M_SQRT1_2 * (BOARD_Y_SIZE-1)))
+ x_size = layout->height * BOARD_X_SIZE / (1 + M_SQRT1_2 * (BOARD_Y_SIZE-1));
/* Size must be a multiple of the integer cell_size */
layout->cell_size = x_size / BOARD_X_SIZE;
x_size = layout->cell_size * BOARD_X_SIZE;
- y_size = layout->cell_size * BOARD_Y_SIZE;
+ y_size = layout->cell_size * (1 + M_SQRT1_2 * (BOARD_Y_SIZE-1));
layout->x_offset = (layout->width - x_size) / 2;
layout->y_offset = (layout->height - y_size) / 2;
cairo_save (cr);
cairo_translate(cr,
- x + (y - DVONN_BOARD_Y_SIZE/2) / 2.0, y);
+ x + (y - DVONN_BOARD_Y_SIZE/2) / 2.0,
+ M_SQRT1_2 * y);
ring_path (cr);
cairo_set_source_rgba (cr, 0.0, 0.0, 0.2, 0.1);
cairo_fill (cr);
view_init (view, game, window);
- gtk_window_set_default_size (GTK_WINDOW (window), 561, 255);
+ gtk_window_set_default_size (GTK_WINDOW (window), 780, 251);
g_signal_connect (window, "delete-event",
G_CALLBACK (on_delete_event_quit), NULL);