Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-01-25 14:04:50 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-01-25 14:07:21 +0300
commit064903f8ed7e7d52e4a6fc6dad42538b52f15efb (patch)
treeb8ad25ef07bdd64190d3ecf82709c716991aca4f /source/blender/blenkernel/intern/image.c
parenta48a66fb19e72531b713840909d93dde8fa3caa0 (diff)
Keep image dimension used by space image and some other tools sync
When using an empty render result (after re-opening the file, i.e.) some tools (like masking) could have used wrong image resolution because of not being aware of special cases supported by the image space to display the render result. This should fix selecting mask points when mask is opened op top if an empty render result.
Diffstat (limited to 'source/blender/blenkernel/intern/image.c')
-rw-r--r--source/blender/blenkernel/intern/image.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index ad1f30555a8..7c40674dd6c 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -4410,6 +4410,15 @@ void BKE_image_get_size(Image *image, ImageUser *iuser, int *width, int *height)
*width = ibuf->x;
*height = ibuf->y;
}
+ else if (image->type == IMA_TYPE_R_RESULT && iuser != NULL && iuser->scene != NULL) {
+ Scene *scene = iuser->scene;
+ *width = (scene->r.xsch * scene->r.size) / 100;
+ *height = (scene->r.ysch * scene->r.size) / 100;
+ if ((scene->r.mode & R_BORDER) && (scene->r.mode & R_CROP)) {
+ *width *= BLI_rctf_size_x(&scene->r.border);
+ *height *= BLI_rctf_size_y(&scene->r.border);
+ }
+ }
else {
*width = IMG_SIZE_FALLBACK;
*height = IMG_SIZE_FALLBACK;