Skip to content

Commit d8f34cb

Browse files
author
Robin Müller
committed
Made zoom delta configurable
1 parent 3cc054a commit d8f34cb

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/configuraion.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ configuration_t read_config(const char *filename) {
8585
result.vert_threshold_percentage = iniparser_getint(ini, "thresholds:vertical", 15);
8686
result.horz_threshold_percentage = iniparser_getint(ini, "thresholds:horizontal", 15);
8787
result.zoom.enabled = iniparser_getboolean(ini, "zoom:enabled", false);
88+
result.zoom.delta = (uint8_t) iniparser_getint(ini, "zoom:delta", 200);
8889

8990
uint8_t i, j;
9091
for (i = 0; i < MAX_FINGERS; i++) {

src/configuraion.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ typedef struct configuration {
4949
} scroll;
5050
struct zoom_options {
5151
bool enabled;
52+
uint8_t delta;
5253
} zoom;
5354
uint8_t vert_threshold_percentage;
5455
uint8_t horz_threshold_percentage;

src/gesture_detection.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,7 @@ static input_event_array_t *process_syn_event(struct input_event event,
304304

305305
if (current_gesture == ZOOM) {
306306
double finger_distance = calculate_distance(mt_slots.points[0], mt_slots.points[1]);
307-
// TODO make zoom delta configurable
308-
result = do_zoom(finger_distance - last_zoom_distance, 200);
307+
result = do_zoom(finger_distance - last_zoom_distance, config.zoom.delta);
309308
last_zoom_distance = finger_distance;
310309
} else {
311310
int32_t x_distance, y_distance;

0 commit comments

Comments
 (0)