diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-17 16:32:13 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-17 16:32:13 +0400 |
commit | 1465b06fad0f6240c73f8bc9f2295912ff8e8d8f (patch) | |
tree | aedb7f002920b7ec62a8b1de9660c8e35d97ae52 /source/blender/editors/space_node/node_view.c | |
parent | dac761057d16e264a74162ba625bdb3c6cf07fb4 (diff) |
code cleanup:
- pass wire color to camera draw_viewport_object_reconstruction() rather then getting the theme color directly.
this makes a change where selection color wont be used for unselected cameras (which IMHO is better, drawing selected wire color on nonselected cameras was confusing).
- use rgb_uchar_to_float()
Diffstat (limited to 'source/blender/editors/space_node/node_view.c')
-rw-r--r-- | source/blender/editors/space_node/node_view.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/editors/space_node/node_view.c b/source/blender/editors/space_node/node_view.c index e0cbbd697d7..79ca10fd7b4 100644 --- a/source/blender/editors/space_node/node_view.c +++ b/source/blender/editors/space_node/node_view.c @@ -375,7 +375,7 @@ int ED_space_node_color_sample(SpaceNode *snode, ARegion *ar, int mval[2], float if (fx >= 0.0f && fy >= 0.0f && fx < 1.0f && fy < 1.0f) { float *fp; - char *cp; + unsigned char *cp; int x = (int)(fx * ibuf->x), y = (int)(fy * ibuf->y); CLAMP(x, 0, ibuf->x - 1); @@ -393,10 +393,8 @@ int ED_space_node_color_sample(SpaceNode *snode, ARegion *ar, int mval[2], float ret = TRUE; } else if (ibuf->rect) { - cp = (char *)(ibuf->rect + y * ibuf->x + x); - r_col[0] = cp[0] / 255.0f; - r_col[1] = cp[1] / 255.0f; - r_col[2] = cp[2] / 255.0f; + cp = (unsigned char *)(ibuf->rect + y * ibuf->x + x); + rgb_uchar_to_float(r_col, cp); ret = TRUE; } } |