mirror of https://git.sr.ht/~kikoodx/kble
Add default scaling level to config, set to 32 by default.
Was 16 before.
This commit is contained in:
parent
a3a4483a44
commit
4eefad9062
|
@ -31,6 +31,8 @@ pub const default_grid_size = .{
|
|||
.height = 16,
|
||||
};
|
||||
|
||||
pub const default_scaling_level = 32;
|
||||
|
||||
pub const theme = .{
|
||||
.background = ray.BLACK,
|
||||
.mode = .{
|
||||
|
|
|
@ -59,7 +59,7 @@ pub fn main() void {
|
|||
var camera: Vec2 = comptime Vec2.init(0, 0);
|
||||
|
||||
// Init scale, used by drawing code.
|
||||
var scale: scaling.scale_type = scaling.scale_default;
|
||||
var scale: scaling.scale_type = conf.default_scaling_level;
|
||||
|
||||
// Create mouse.
|
||||
var mouse: Mouse = comptime Mouse.init();
|
||||
|
@ -270,6 +270,7 @@ pub fn main() void {
|
|||
draw.rectangle_selection(scale, camera, Rect.init_from_vec2(cursor, cursor_before), mode == .rectangle);
|
||||
if (conf.mouse_enabled)
|
||||
mouse.draw(scale, camera);
|
||||
//ray.DrawFPS(0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,15 +8,15 @@ const std = @import("std");
|
|||
const expect = std.testing.expect;
|
||||
const maxInt = std.math.maxInt;
|
||||
|
||||
const conf = @import("conf.zig");
|
||||
const Parameter = @import("parameter.zig");
|
||||
|
||||
pub const scale_type = u8;
|
||||
pub const scale_default: comptime_int = 16;
|
||||
const scale_min = 3;
|
||||
const scale_max = maxInt(scale_type);
|
||||
|
||||
pub fn scale_reset(current_scale: scale_type, arg: Parameter.buffer_type) scale_type {
|
||||
return scale_default;
|
||||
return conf.default_scaling_level;
|
||||
}
|
||||
|
||||
pub fn scale_up(current_scale: scale_type, arg: Parameter.buffer_type) scale_type {
|
||||
|
@ -32,7 +32,7 @@ pub fn scale_down(current_scale: scale_type, arg: Parameter.buffer_type) scale_t
|
|||
}
|
||||
|
||||
test "scale reset" {
|
||||
expect(scale_reset(42, 1) == scale_default);
|
||||
expect(scale_reset(42, 1) == conf.default_scaling_level);
|
||||
}
|
||||
|
||||
test "scale up" {
|
||||
|
|
Loading…
Reference in New Issue