-rw-r--r-- | src/controller/clear_selection.sqc | 9 | ||||
-rw-r--r-- | src/controller/exp004processhits.c | 6 | ||||
-rw-r--r-- | src/controller/keyboard.c | 10 | ||||
-rw-r--r-- | src/controller/selection_from_db.sqc | 6 | ||||
-rw-r--r-- | src/model/density_legend_geometry.c | 20 | ||||
-rw-r--r-- | src/model/exp004state.h | 7 | ||||
-rw-r--r-- | src/model/protein_geometry.c | 2 | ||||
-rw-r--r-- | src/view/exp004geometry.c | 26 | ||||
-rw-r--r-- | src/view/exp004init.c | 3 |
9 files changed, 59 insertions, 30 deletions
diff --git a/src/model/density_legend_geometry.c b/src/model/density_legend_geometry.c index ab3e46c..7e30de8 100644 --- a/src/model/density_legend_geometry.c +++ b/src/model/density_legend_geometry.c @@ -2,7 +2,6 @@ #include "../view/exp004state0.h" #include "../controller/exp004reshape.h" #include <GL/glut.h> -#include <stdio.h> #define S exp004state0 @@ -15,13 +14,6 @@ density_legend_geometry (void) DEFAULT_COLOR_A); /* - * This value should be a percentage of the world height so that it - * remains a fixed number of pixels tall when the window is resized - * or zoomed. - */ - double legend_height = 0.5; - - /* * Calculate the bounding box for the legend. */ @@ -33,20 +25,30 @@ density_legend_geometry (void) const double *left; const double *right; const double *top; + const double *bottom; if (S.zoom.active) { left = &S.zoom.coords[0]; right = &S.zoom.coords[1]; + bottom = &S.zoom.coords[2]; top = &S.zoom.coords[3]; } else { left = &S.ortho.min_x; - top = &S.ortho.max_y; right = &S.ortho.max_x; + bottom = &S.ortho.min_y; + top = &S.ortho.max_y; } + /* + * This value should be a percentage of the world height so that it + * remains a fixed number of pixels tall when the window is resized + * or zoomed. + */ + double legend_height = (*top - *bottom) / S.viewport.h * 10.0; + a[0] = *left; a[1] = *top; b[0] = *right; |