diff --git a/data/camera.css b/data/camera.css index 316209d..85c65e3 100644 --- a/data/camera.css +++ b/data/camera.css @@ -4,9 +4,10 @@ } .controlbox { - background: rgba(0,0,0,0.2); + background: rgba(0, 0, 0, 0.2); } .button-overlay { opacity: 0.9; + background-color: rgba(0, 0, 0, 0.2); } diff --git a/data/camera.ui b/data/camera.ui index 9a3cc76..a6580d1 100644 --- a/data/camera.ui +++ b/data/camera.ui @@ -25,19 +25,19 @@ vertical - 1 - 1 + fill + start 5 0 - 5 - 5 - 5 - 5 horizontal 1 start + 5 + 5 + 5 + 5 0 5 @@ -64,6 +64,10 @@ 0 start + 5 + 5 + 5 + 5 horizontal @@ -85,87 +89,94 @@ + + + + + + horizontal + fill + end horizontal 1 - 1 end - 0 + 5 + 5 + 5 + 5 - - horizontal - 1 - end + + app.open-settings + settings-symbolic + + + + + app.switch-camera + switch-camera-symbolic + + + + + + + 5 + 5 + app.capture + + + 60 0 - 5 + shutter-button-symbolic + + + + + + + + horizontal + 1 + end + end + 5 + 5 + 5 + 5 + + + app.open-last - - app.open-settings - settings-symbolic - - - - - app.switch-camera - switch-camera-symbolic + + 0 + + + 24 + 24 + 0 + + + + + 24 + 24 + 0 + + - app.capture - - - 60 - 0 - shutter-button-symbolic - - - - - - - - horizontal - 1 - end - end - 0 - 5 - - - app.open-last - - - 0 - - - 24 - 24 - 0 - - - - - 24 - 24 - 0 - - - - - - - - - app.open-photos - folder-symbolic - - + app.open-photos + folder-symbolic diff --git a/src/main.c b/src/main.c index aeac5a0..804e718 100644 --- a/src/main.c +++ b/src/main.c @@ -545,6 +545,7 @@ static void preview_pressed(GtkGestureClick *gesture, int n_press, double x, double y) { GtkWidget *widget = gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(gesture)); + int scale_factor = gtk_widget_get_scale_factor(widget); // Tapped zbar result if (zbar_result) { @@ -552,9 +553,8 @@ preview_pressed(GtkGestureClick *gesture, int n_press, double x, double y) float offset_x, offset_y, size_x, size_y; position_preview(&offset_x, &offset_y, &size_x, &size_y); - double scale = preview_buffer_height / size_y; - int zbar_x = (x - offset_x) * scale; - int zbar_y = (y - offset_y) * scale; + int zbar_x = (x - offset_x) * scale_factor / size_x * preview_buffer_width; + int zbar_y = (y - offset_y) * scale_factor / size_y * preview_buffer_height; for (uint8_t i = 0; i < zbar_result->size; ++i) { MPZBarCode *code = &zbar_result->codes[i]; diff --git a/src/process_pipeline.c b/src/process_pipeline.c index 18ffb80..ae8cebe 100644 --- a/src/process_pipeline.c +++ b/src/process_pipeline.c @@ -255,7 +255,9 @@ mp_process_pipeline_init_gl(GdkSurface *surface) static cairo_surface_t * process_image_for_preview(const uint8_t *image) { +#ifdef PROFILE_DEBAYER clock_t t1 = clock(); +#endif // Pick an available buffer MPProcessPipelineBuffer *output_buffer = NULL; @@ -293,8 +295,10 @@ process_image_for_preview(const uint8_t *image) glDeleteTextures(1, &input_texture); +#ifdef PROFILE_DEBAYER clock_t t2 = clock(); printf("%fms\n", (float)(t2 - t1) / CLOCKS_PER_SEC * 1000); +#endif // { // glBindTexture(GL_TEXTURE_2D, textures[1]);