From 6a5bd812b569d5fe1f09bd5610ce9d0c119f1a21 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Mon, 23 Mar 2020 13:51:55 +0100 Subject: Fix T74586: Image Editor Uses Invalid Display Channels When using the image editor the display channels attribute can become invalid when selecting another image/buffer. This patch will check what display channels are valid and when an invalid channel is selected it will fall back to the color channel. To de-duplicate the code it also introduces a `ED_space_image_get_display_channel_mask` function that will determine the valid bitflags for the display channel of a given `ImBuf`. --- source/blender/editors/include/ED_image.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/editors/include/ED_image.h') diff --git a/source/blender/editors/include/ED_image.h b/source/blender/editors/include/ED_image.h index 0e820a1c2d6..1c260bb826a 100644 --- a/source/blender/editors/include/ED_image.h +++ b/source/blender/editors/include/ED_image.h @@ -61,6 +61,7 @@ bool ED_space_image_color_sample(struct SpaceImage *sima, int mval[2], float r_col[3]); struct ImBuf *ED_space_image_acquire_buffer(struct SpaceImage *sima, void **r_lock, int tile); +int ED_space_image_get_display_channel_mask(struct ImBuf *ibuf); void ED_space_image_release_buffer(struct SpaceImage *sima, struct ImBuf *ibuf, void *lock); bool ED_space_image_has_buffer(struct SpaceImage *sima); -- cgit v1.2.3