Skip to content

Commit d37dbed

Browse files
committed
fix scroll direction: in scopes, up/right (both for exposure and black level) will now mean brightening (moving exposure in the positive, black level correction in the negative direction)
1 parent ee37574 commit d37dbed

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/iop/exposure.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,8 @@ static void _exposure_proxy_handle_event(int n_press,
840840
? g->deflicker_target_level : g->exposure);
841841
const float val = dt_bauhaus_slider_get(widget);
842842
const float accel = dt_accel_get_speed_multiplier(widget, state);
843+
// delta > 0 means 'brighten'; increase exposure or move the black point correction
844+
// in the negative direction
843845
if(is_blackpoint)
844846
delta = -delta;
845847

src/libs/histogram.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,17 @@ static void _eventbox_scroll_callback(GtkEventControllerScroll* self,
502502
// FIXME: should handle smooth scrolling rather than discrete?
503503
// FIXME: should scrolling of scope be handled in the drawable rather than
504504
// the eventbox.
505-
dt_dev_exposure_handle_event(0, dy - dx, event->scroll.state,
505+
506+
// get the dominant direction, standardize on delta < 0 => up==right
507+
const gdouble delta = fabs(dx) > fabs(dy) ? -dx : dy;
508+
// for exposure ('highlight') mode: we want up/right: brighten the image
509+
// -> increase exposure, or decrease black point (exposure handles that);
510+
// in vectorscope, rgb parade, parts of the visualization moves upwards;
511+
// in histogram, to the right.
512+
// dt_dev_exposure_handle_event requires 'delta' in the 'brighten' > 0 convention, that is also what
513+
// drag events emit
514+
515+
dt_dev_exposure_handle_event(0, - delta, event->scroll.state,
506516
s->highlight == DT_SCOPES_HIGHLIGHT_BLACK_POINT);
507517
}
508518
else

0 commit comments

Comments
 (0)