From ece2733c63abbdc05b9d5b32ed4ad7ed3f0700d7 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 26 Jun 2005 15:37:36 +0000 Subject: Patch by Martin Poirier: display normalized coordinates in image window, with a few small modifications: - also display normalized coords while transforming - adapt step size & precision for button - moved option to 'View' menu Also made sure pixel snapping when transforming uv's is off by default. --- source/blender/src/editsima.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'source/blender/src/editsima.c') diff --git a/source/blender/src/editsima.c b/source/blender/src/editsima.c index fc6506579ab..8cb75c59050 100644 --- a/source/blender/src/editsima.c +++ b/source/blender/src/editsima.c @@ -229,12 +229,8 @@ static void sima_pixelgrid(float *loc, float sx, float sy) { float y; float x; - - if(G.sima->flag & SI_NOPIXELSNAP) { - loc[0]= sx; - loc[1]= sy; - } - else { + + if(G.sima->flag & SI_PIXELSNAP) { if(G.sima->image && G.sima->image->ibuf) { x= G.sima->image->ibuf->x; y= G.sima->image->ibuf->y; @@ -256,6 +252,10 @@ static void sima_pixelgrid(float *loc, float sx, float sy) loc[1]= sy; } } + else { + loc[0]= sx; + loc[1]= sy; + } } @@ -539,11 +539,17 @@ void transform_tface_uv(int mode, int context) // 2 args, for callback } } - ivec[0]= (vec[0]*xim); - ivec[1]= (vec[1]*yim); - if(G.sima->flag & SI_BE_SQUARE) be_square_tface_uv(me); - + + if (G.sima->flag & SI_COORDFLOATS) { + ivec[0]= vec[0]; + ivec[1]= vec[1]; + } + else { + ivec[0]= (vec[0]*xim); + ivec[1]= (vec[1]*yim); + } + sprintf(str, "X: %.4f Y: %.4f ", ivec[0], ivec[1]); headerprint(str); } -- cgit v1.2.3