mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 08:38:27 -05:00
LOLWUT: change padding conditional to a more direct one.
This commit is contained in:
parent
02817d8b3d
commit
5c9a7b891f
@ -177,7 +177,7 @@ void lwDrawSquare(lwCanvas *canvas, int x, int y, float size, float angle) {
|
|||||||
lwCanvas *lwDrawSchotter(int console_cols, int squares_per_row, int squares_per_col) {
|
lwCanvas *lwDrawSchotter(int console_cols, int squares_per_row, int squares_per_col) {
|
||||||
/* Calculate the canvas size. */
|
/* Calculate the canvas size. */
|
||||||
int canvas_width = console_cols*2;
|
int canvas_width = console_cols*2;
|
||||||
int padding = console_cols > 2 ? 2 : 0;
|
int padding = canvas_width > 4 ? 2 : 0;
|
||||||
float square_side = (float)(canvas_width-padding*2) / squares_per_row;
|
float square_side = (float)(canvas_width-padding*2) / squares_per_row;
|
||||||
int canvas_height = square_side * squares_per_col + padding*2;
|
int canvas_height = square_side * squares_per_col + padding*2;
|
||||||
lwCanvas *canvas = lwCreateCanvas(canvas_width, canvas_height);
|
lwCanvas *canvas = lwCreateCanvas(canvas_width, canvas_height);
|
||||||
|
Loading…
Reference in New Issue
Block a user