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@pandora.be>2009-09-28 12:52:02 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-09-28 12:52:02 +0400
commitea187e54a8cd4456dbbfb474ba652b2aab69756f (patch)
tree99d8749a615dc43e708a4762b578fe5ef9189a47 /source/blender/editors/space_image
parent92ee7ca94659783230ae1d10ab63ab7684718e8f (diff)
Fix #19482: setting cursor position in uv editor was not correct
zoomed in, needed to make view2d offset for pixel rounding dependent on zoom level.
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r--source/blender/editors/space_image/space_image.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index f041cb00ee4..55b910cf6b4 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -374,8 +374,8 @@ static void image_main_area_set_view2d(SpaceImage *sima, ARegion *ar, Scene *sce
ar->v2d.mask.ymax= winy;
/* which part of the image space do we see? */
- x1= ar->winrct.xmin+(winx-sima->zoom*w)/2;
- y1= ar->winrct.ymin+(winy-sima->zoom*h)/2;
+ x1= ar->winrct.xmin+(winx-sima->zoom*w)/2.0f;
+ y1= ar->winrct.ymin+(winy-sima->zoom*h)/2.0f;
x1-= sima->zoom*sima->xof;
y1-= sima->zoom*sima->yof;
@@ -440,11 +440,13 @@ static void image_main_area_draw(const bContext *C, ARegion *ar)
/* and uvs in 0.0-1.0 space */
UI_view2d_view_ortho(C, v2d);
- draw_uvedit_main(sima, ar, scene, obedit);
- ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST);
+ draw_uvedit_main(sima, ar, scene, obedit);
+
+ ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST);
- /* Grease Pencil too (in addition to UV's) */
- draw_image_grease_pencil((bContext *)C, 1);
+ /* Grease Pencil too (in addition to UV's) */
+ draw_image_grease_pencil((bContext *)C, 1);
+
UI_view2d_view_restore(C);
/* draw Grease Pencil - screen space only */