X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=blobdiff_plain;f=alg%2Fglseqbrowser.cpp;h=df9462618b119f56c704a234a059d184ef2c8a4a;hp=afcf6a97fc72d86df432e88978bb20a86c4f64cf;hb=1498ea34399110d081cd06cb8eefb8950e2312c7;hpb=a4afd5d6682accf2e2d0f414fb2e16813786eff3 diff --git a/alg/glseqbrowser.cpp b/alg/glseqbrowser.cpp index afcf6a9..df94626 100644 --- a/alg/glseqbrowser.cpp +++ b/alg/glseqbrowser.cpp @@ -144,10 +144,8 @@ void GlSeqBrowser::processSelection(GLuint hits, GLuint buffer[], GLuint bufsize void GlSeqBrowser::selectRegion(int top, int left, int bottom, int right) { - GLfloat x_scale = cur_ortho.width()/((float)viewport_size.x); - GLfloat y_scale = cur_ortho.height()/((float)viewport_size.y); - GLfloat x_left = cur_ortho.left + (left*x_scale); - GLfloat x_right = cur_ortho.left + (right * x_scale); + GLfloat x_left = viewportXtoWorldX(left); + GLfloat x_right = viewportXtoWorldX(right);cur_ortho.left; if (top > bottom) { // woah, someone gave us a rectangle with the origin in the lower left @@ -156,8 +154,8 @@ void GlSeqBrowser::selectRegion(int top, int left, int bottom, int right) top = temp; } // swap the orientation of canvas coordinates - GLfloat y_top = cur_ortho.top-(bottom*y_scale); - GLfloat y_bottom = cur_ortho.top - top * y_scale; + GLfloat y_top = viewportYtoWorldY(bottom); + GLfloat y_bottom = viewportYtoWorldY(top); selectedRegion = rect(y_top, x_left, y_bottom, x_right); // hopefully this will make a buffer big enough to receive