diff options
author | Matt Ebb <matt@mke3.net> | 2010-01-19 05:26:36 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-01-19 05:26:36 +0300 |
commit | 2fa3baf30b3ea1b6c681517efb4b122c2a512175 (patch) | |
tree | a0f7273cd53e5443b2444276c983c0fadcdaa568 /source/blender/editors/space_image | |
parent | b079dcc140f9c9141cf12ac15cc4e65c0fcee1e5 (diff) |
* Make image Histogram only update when region is visible
* Clean up some remaining code
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r-- | source/blender/editors/space_image/image_draw.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 23 |
2 files changed, 17 insertions, 16 deletions
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index 2b2f1f0b3e4..8889ca5c052 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -204,16 +204,6 @@ void draw_image_info(ARegion *ar, int channels, int x, int y, char *cp, float *f UI_DrawString(10, 10, str); } -static inline int get_bin_float(float f) -{ - CLAMP(f, 0.0, 1.0); - - //return (int) (((f + 0.25) / 1.5) * 512); - - return (int)(f * 511); -} - - /* image drawing */ static void draw_image_grid(ARegion *ar, float zoomx, float zoomy) diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 62021f824ae..0a3367b0427 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -75,6 +75,21 @@ #include "image_intern.h" + +static void image_histogram_tag_refresh(ScrArea *sa) +{ + SpaceImage *sima= (SpaceImage *)sa->spacedata.first; + ARegion *ar; + + /* only while histogram is visible */ + for (ar=sa->regionbase.first; ar; ar=ar->next) { + if (ar->regiontype == RGN_TYPE_PREVIEW && ar->flag & RGN_FLAG_HIDDEN) + return; + } + + sima->hist.ok=0; +} + /* ******************** manage regions ********************* */ ARegion *image_has_buttons_region(ScrArea *sa) @@ -128,6 +143,8 @@ ARegion *image_has_scope_region(ScrArea *sa) arnew->flag = RGN_FLAG_HIDDEN; + image_histogram_tag_refresh(sa); + return arnew; } @@ -315,12 +332,6 @@ static void image_refresh(const bContext *C, ScrArea *sa) } } -static void image_histogram_tag_refresh(ScrArea *sa) -{ - SpaceImage *sima= (SpaceImage *)sa->spacedata.first; - sima->hist.ok=0; -} - static void image_listener(ScrArea *sa, wmNotifier *wmn) { SpaceImage *sima= (SpaceImage *)sa->spacedata.first; |