From 7d294dca8bbf4a464cabb058d8ea68f759441481 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 2 Aug 2011 16:01:14 +0200 Subject: render_hkl: Fix "squashed zone axes" --- src/render_hkl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/render_hkl.c') diff --git a/src/render_hkl.c b/src/render_hkl.c index 50450a94..a3cd48c6 100644 --- a/src/render_hkl.c +++ b/src/render_hkl.c @@ -94,9 +94,13 @@ static void draw_circles(double xh, double xk, double xl, Reflection *refl; RefListIterator *iter; SymOpMask *m; + double nx, ny; m = new_symopmask(sym); + nx = xh*xh + xk*xk + xl*xl; + ny = yh*yh + yk*yk + yl*yl; + /* Iterate over all reflections */ for ( refl = first_refl(list, &iter); refl != NULL; @@ -121,8 +125,8 @@ static void draw_circles(double xh, double xk, double xl, /* Is the reflection in the zone? */ if ( h*zh + k*zk + l*zl != 0 ) continue; - xi = h*xh + k*xk + l*xl; - yi = h*yh + k*yk + l*yl; + xi = (h*xh + k*xk + l*xl) / nx; + yi = (h*yh + k*yk + l*yl) / ny; switch ( wght) { case WGHT_I : -- cgit v1.2.3