From b36001e209aa0354c02a3701415d0476d09ad196 Mon Sep 17 00:00:00 2001 From: KikooDX Date: Sun, 28 Feb 2021 01:45:18 +0100 Subject: [PATCH] Adaptive window size. Updated README.md. --- README.md | 5 ++++- src/conf.zig | 2 ++ src/main.zig | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 20d2338..1f8d6e4 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,10 @@ In `src/conf.zig`, edit values from `BEGIN USER CONFIG`. The configuration is applied at compile time. You have the possibility to: * Disable mouse support. * Swap mouse buttons. +* Disable backups. +* Change default grid size. +* Change default scaling level. +* Disable adaptive window size. * Change and add colors. * Edit keybindings. @@ -91,7 +95,6 @@ Modes: * Left or right click while un·selecting: end selection. # Backups -*Can be disabled in the configuration.* Safety backups are made when: * Reading operation is started (`backup_read.kble`) * The program exit (`backup_exit.kble`) diff --git a/src/conf.zig b/src/conf.zig index 32f8aea..b3b0bd7 100644 --- a/src/conf.zig +++ b/src/conf.zig @@ -42,6 +42,8 @@ pub const default_window_size = .{ .height = default_grid_size.width * default_scaling_level, }; +pub const adaptive_window_size = true; + pub const theme = .{ .background = ray.BLACK, .mode = .{ diff --git a/src/main.zig b/src/main.zig index 9354ec6..27f6569 100644 --- a/src/main.zig +++ b/src/main.zig @@ -259,6 +259,13 @@ pub fn main() void { } } + // Adaptive window size. + if (conf.adaptive_window_size) { + const width = level.width * scale; + const height = level.height * scale; + ray.SetWindowSize(width, height); + } + ray.BeginDrawing(); defer ray.EndDrawing();