Commit 3491cf2f authored by Sebastian Krzyszkowiak's avatar Sebastian Krzyszkowiak
Browse files

Merge branch 'inv-fo' into 'master'

Invert the focus slider values

See merge request Librem5/megapixels!43
parents 0a983d15 2346439e
......@@ -619,7 +619,7 @@ on_preview_tap(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
false);
gtk_adjustment_set_lower(control_slider, 0.0);
gtk_adjustment_set_upper(control_slider, 16383);
gtk_adjustment_set_value(control_slider, (double)focus);
gtk_adjustment_set_value(control_slider, 16383 - focus);
}
gtk_widget_show(control_box);
......@@ -724,7 +724,7 @@ on_control_slider_changed(GtkAdjustment *widget, gpointer user_data)
}
case USER_CONTROL_FOCUS:
if (value != focus) {
focus = (int)value;
focus = 16383 - value;
has_changed = true;
char buf[42] = {};
snprintf(buf, 42, "sudo i2ctransfer -f -y 3 w2@0xc 0x%02x 0x%02x", (uint8_t)(focus >> 8), (uint8_t)(focus & 0xff));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment