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>2013-08-27 00:23:26 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-08-27 00:23:26 +0400
commit03dbae07d346dcfb5cdaeeeea3585f642cd90d31 (patch)
tree866db44539cf778c636cd774f524970d434c77d3 /source/blender/editors/uvedit/uvedit_draw.c
parent11aa7a76fab53809f891ab8ff7898a2dd70005b8 (diff)
Mask primitives
Currently only circle and square, might be easily extended in the future. New primitives are creating at cursor location. This also implied adding 2d cursor to space clip. Also fix set 2D cursor location which didn't work in image editor's mask mode since 2.67. TODO: draw_image_cursor better be moved to some more generic file, but it's not so much important for now and might be solved later. Thanks Campbell for the review!
Diffstat (limited to 'source/blender/editors/uvedit/uvedit_draw.c')
-rw-r--r--source/blender/editors/uvedit/uvedit_draw.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c
index a873702b5b8..1ae1d57b77c 100644
--- a/source/blender/editors/uvedit/uvedit_draw.c
+++ b/source/blender/editors/uvedit/uvedit_draw.c
@@ -69,7 +69,7 @@
#define USE_EDBM_LOOPTRIS
-void draw_image_cursor(SpaceImage *sima, ARegion *ar)
+void draw_image_cursor(ARegion *ar, const float cursor[2])
{
float zoom[2], x_fac, y_fac;
@@ -80,7 +80,7 @@ void draw_image_cursor(SpaceImage *sima, ARegion *ar)
y_fac = zoom[1];
cpack(0xFFFFFF);
- glTranslatef(sima->cursor[0], sima->cursor[1], 0.0);
+ glTranslatef(cursor[0], cursor[1], 0.0);
fdrawline(-0.05f * x_fac, 0, 0, 0.05f * y_fac);
fdrawline(0, 0.05f * y_fac, 0.05f * x_fac, 0.0f);
fdrawline(0.05f * x_fac, 0.0f, 0.0f, -0.05f * y_fac);
@@ -108,7 +108,7 @@ void draw_image_cursor(SpaceImage *sima, ARegion *ar)
fdrawline(0.0f, -0.020f * y_fac, 0.0f, -0.1f * y_fac);
fdrawline(0.0f, 0.1f * y_fac, 0.0f, 0.020f * y_fac);
- glTranslatef(-sima->cursor[0], -sima->cursor[1], 0.0);
+ glTranslatef(-cursor[0], -cursor[1], 0.0);
setlinestyle(0);
}
@@ -884,7 +884,7 @@ void draw_uvedit_main(SpaceImage *sima, ARegion *ar, Scene *scene, Object *obedi
draw_uvs_texpaint(sima, scene, obact);
if (show_uvedit && !(toolsettings->use_uv_sculpt))
- draw_image_cursor(sima, ar);
+ draw_image_cursor(ar, sima->cursor);
}
}