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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-12-03 22:06:10 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-12-03 22:08:20 +0300
commitf0432e37ab06831167cf84c589fad7d5a28d54ef (patch)
tree63cce1d8d192323a05833890e3aa6656e511ec03 /source/blender/editors/space_image
parentdc26c5e1ad98b47675ee9345af301a937905808d (diff)
Fix T58636: repeat image in UV editor not working.
A little too much code got removed in fb24813.
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r--source/blender/editors/space_image/image_draw.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index 4cbe25462af..a46767495dd 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -549,6 +549,26 @@ static void draw_image_buffer(const bContext *C, SpaceImage *sima, ARegion *ar,
}
}
+static void draw_image_buffer_repeated(const bContext *C, SpaceImage *sima, ARegion *ar, Scene *scene, ImBuf *ibuf, float zoomx, float zoomy)
+{
+ const double time_current = PIL_check_seconds_timer();
+
+ const int xmax = ceil(ar->v2d.cur.xmax);
+ const int ymax = ceil(ar->v2d.cur.ymax);
+ const int xmin = floor(ar->v2d.cur.xmin);
+ const int ymin = floor(ar->v2d.cur.ymin);
+
+ for (int x = xmin; x < xmax; x++) {
+ for (int y = ymin; y < ymax; y++) {
+ draw_image_buffer(C, sima, ar, scene, ibuf, x, y, zoomx, zoomy);
+
+ /* only draw until running out of time */
+ if ((PIL_check_seconds_timer() - time_current) > 0.25)
+ return;
+ }
+ }
+}
+
/* draw uv edit */
/* draw grease pencil */
@@ -699,7 +719,10 @@ void draw_image_main(const bContext *C, ARegion *ar)
ED_region_grid_draw(ar, zoomx, zoomy);
}
else {
- draw_image_buffer(C, sima, ar, scene, ibuf, 0.0f, 0.0f, zoomx, zoomy);
+ if (sima->flag & SI_DRAW_TILE)
+ draw_image_buffer_repeated(C, sima, ar, scene, ibuf, zoomx, zoomy);
+ else
+ draw_image_buffer(C, sima, ar, scene, ibuf, 0.0f, 0.0f, zoomx, zoomy);
if (sima->flag & SI_DRAW_METADATA) {
int x, y;