From b74f2c7d74dc18ab9afa105a2cfe547fabb42d57 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 19 Oct 2021 12:22:06 +1100 Subject: Fix image cache margin calculation This margin was inconsistently calculated: only taking the visible region and interface scale into account in some cases. --- source/blender/editors/include/ED_image.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/include') diff --git a/source/blender/editors/include/ED_image.h b/source/blender/editors/include/ED_image.h index f0e8f7f0a39..1400bcf5ee3 100644 --- a/source/blender/editors/include/ED_image.h +++ b/source/blender/editors/include/ED_image.h @@ -53,13 +53,13 @@ float ED_space_image_increment_snap_value(const int grid_dimesnions, const float zoom_factor); /* image_edit.c, exported for transform */ -struct Image *ED_space_image(struct SpaceImage *sima); +struct Image *ED_space_image(const struct SpaceImage *sima); void ED_space_image_set(struct Main *bmain, struct SpaceImage *sima, struct Image *ima, bool automatic); void ED_space_image_auto_set(const struct bContext *C, struct SpaceImage *sima); -struct Mask *ED_space_image_get_mask(struct SpaceImage *sima); +struct Mask *ED_space_image_get_mask(const struct SpaceImage *sima); void ED_space_image_set_mask(struct bContext *C, struct SpaceImage *sima, struct Mask *mask); bool ED_space_image_get_position(struct SpaceImage *sima, @@ -136,7 +136,10 @@ void ED_image_draw_info(struct Scene *scene, const int *zp, const float *zpf); -bool ED_space_image_show_cache(struct SpaceImage *sima); +bool ED_space_image_show_cache(const struct SpaceImage *sima); +bool ED_space_image_show_cache_and_mval_over(const struct SpaceImage *sima, + struct ARegion *region, + const int mval[2]); bool ED_image_should_save_modified(const struct Main *bmain); int ED_image_save_all_modified_info(const struct Main *bmain, struct ReportList *reports); -- cgit v1.2.3