[app] Ensure calculated histogram spike height ...

is positive or zero. Sometimes the calculated `y` or `bg_y`
values are negative because the histogram value was divided
by zero (when max == 0.0).

Resolves: #9132 (Gnome/GIMP bug tracker)
(cherry picked from commit 9b517fbf7d)
This commit is contained in:
Stanislav Grinkov
2023-02-09 23:05:27 +06:00
parent ab53ec2de4
commit 2d59d233ef

View File

@ -500,6 +500,9 @@ gimp_histogram_view_draw_spike (GimpHistogramView *view,
break;
}
y = MAX (y, 0);
bg_y = MAX (bg_y, 0);
if (bg_color)
{
gdk_cairo_set_source_color (cr, bg_color);