Small fix for sample line tool. Set luma data to 0 when out of bounds.

This commit is contained in:
Xavier Thomas
2010-06-06 16:26:49 +00:00
parent 8eaa8a0763
commit ce9d2b8eb4

View File

@@ -1705,7 +1705,7 @@ static int sample_line_exec(bContext *C, wmOperator *op)
y= (int)(0.5f + y1 + (float)i*(y2-y1)/255.0f);
if (x<0 || y<0 || x>=ibuf->x || y>=ibuf->y) {
hist->data_r[i] = hist->data_g[i]= hist->data_b[i] = 0.0f;
hist->data_luma[i] = hist->data_r[i] = hist->data_g[i]= hist->data_b[i] = 0.0f;
} else {
if (ibuf->rect_float) {
fp= (ibuf->rect_float + (ibuf->channels)*(y*ibuf->x + x));