diff options
author | Ton Roosendaal <ton@blender.org> | 2006-10-28 00:27:13 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-10-28 00:27:13 +0400 |
commit | 129cab4137d2a928e68eec7f7647b1f2b690686a (patch) | |
tree | dbb71785f612bbb1e919f102cfc78213f7302f4e /source/blender/src/interface_draw.c | |
parent | a7d3a58ba9e7a42781a21c8015cdd51a76473056 (diff) |
New Curves Widget option: curves can get extrapolated extension.
Especially for Compositing it was annoying that colors always got clipped
in the 0.0-1.0 range. For this reason, extrapolated Curves now is the
default. Old saved files still have horizontal extrapolation.
Set the option with 'Tools' menu (wrench icon). This is a setting per
curve, so you might need to set all 4 curves for an RGBA curves widget.
Diffstat (limited to 'source/blender/src/interface_draw.c')
-rw-r--r-- | source/blender/src/interface_draw.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/source/blender/src/interface_draw.c b/source/blender/src/interface_draw.c index f42d16a6d5a..2d5d8f8a483 100644 --- a/source/blender/src/interface_draw.c +++ b/source/blender/src/interface_draw.c @@ -2187,13 +2187,27 @@ static void ui_draw_but_CURVE(uiBut *but) curvemapping_changed(cumap, 0); /* 0 = no remove doubles */ cmp= cuma->table; - glVertex2f(but->x1, but->y1 + zoomy*(cmp[0].y-offsy)); /* first point */ + /* first point */ + if((cuma->flag & CUMA_EXTEND_EXTRAPOLATE)==0) + glVertex2f(but->x1, but->y1 + zoomy*(cmp[0].y-offsy)); + else { + fx= but->x1 + zoomx*(cmp[0].x-offsx + cuma->ext_in[0]); + fy= but->y1 + zoomy*(cmp[0].y-offsy + cuma->ext_in[1]); + glVertex2f(fx, fy); + } for(a=0; a<=CM_TABLE; a++) { fx= but->x1 + zoomx*(cmp[a].x-offsx); fy= but->y1 + zoomy*(cmp[a].y-offsy); glVertex2f(fx, fy); } - glVertex2f(but->x2, but->y1 + zoomy*(cmp[CM_TABLE].y-offsy)); /* last point */ + /* last point */ + if((cuma->flag & CUMA_EXTEND_EXTRAPOLATE)==0) + glVertex2f(but->x2, but->y1 + zoomy*(cmp[CM_TABLE].y-offsy)); + else { + fx= but->x1 + zoomx*(cmp[CM_TABLE].x-offsx - cuma->ext_out[0]); + fy= but->y1 + zoomy*(cmp[CM_TABLE].y-offsy - cuma->ext_out[1]); + glVertex2f(fx, fy); + } glEnd(); /* the points, use aspect to make them visible on edges */ |