diff --git a/Graphs/gFooBar.cpp b/Graphs/gFooBar.cpp index 1f32fb82..6f4fb3b1 100644 --- a/Graphs/gFooBar.cpp +++ b/Graphs/gFooBar.cpp @@ -21,7 +21,7 @@ void gShadowArea::paint(gGraph & w,int left, int top, int width, int height) if (xx==0) return; - int start_px=left; + int start_px=left-1; int end_px=left+width; float h=top; @@ -48,6 +48,17 @@ void gShadowArea::paint(gGraph & w,int left, int top, int width, int height) glEnd(); glDisable(GL_BLEND); + glLineWidth(2); + w.qglColor(Qt::blue); + glBegin(GL_LINES); + glVertex2f(start_px+px, top); + glVertex2f(start_px+py, top); + glVertex2f(start_px+px, top+height+1); + glVertex2f(start_px+py, top+height+1); + glEnd(); + + glLineWidth(1); + //glFlush(); } diff --git a/Graphs/gGraphView.cpp b/Graphs/gGraphView.cpp index 2fe57487..f343d988 100644 --- a/Graphs/gGraphView.cpp +++ b/Graphs/gGraphView.cpp @@ -417,12 +417,38 @@ void gGraph::mouseReleaseEvent(QMouseEvent * event) //qDebug() << m_title << "Released" << min_x << max_x << x << y << x2 << y2 << left << right << top << bottom << m_width << m_height; if ((m_graphview->horizTravel()<4) && (x>left+m_marginleft && xtop+m_margintop && ybutton() & Qt::RightButton) { - ZoomX(1.33,x); // Zoon out - return; - } else if (event->button() & Qt::LeftButton) { - ZoomX(0.75,x); // zoom in. - return; + if (!m_blockzoom) { + if (event->button() & Qt::RightButton) { + ZoomX(1.33,x); // Zoon out + return; + } else if (event->button() & Qt::LeftButton) { + ZoomX(0.75,x); // zoom in. + return; + } + } else { + x-=left+m_marginleft; + y-=top+m_margintop; + //w-=m_marginleft+left; + double qq=rmax_x-rmin_x; + double xmult,j1; + + double xx=max_x-min_x; + if (xx==qq) xx=1800000; + + xmult=qq/double(w); + j1=(xmult*x); + min_x=rmin_x+j1-(xx/2); + max_x=min_x+xx; + if (min_xrmax_x) { + max_x=rmax_x; + min_x=rmax_x-xx; + } + m_graphview->SetXBounds(min_x,max_x,m_group); + } } if (m_selecting_area) { diff --git a/Graphs/gXAxis.cpp b/Graphs/gXAxis.cpp index 8c4a6988..fcbcb541 100644 --- a/Graphs/gXAxis.cpp +++ b/Graphs/gXAxis.cpp @@ -207,14 +207,14 @@ void gXAxis::paint(gGraph & w,int left,int top, int width, int height) glColor4ub(255,255,255,255); glVertex2f(left-20,top+5); glVertex2f(left-20,top+height); - glColor4ub(255,255,255,0); - glVertex2f(left+40,top+height); - glVertex2f(left+40,top+5); + //glColor4ub(255,255,255,0); + glVertex2f(left,top+height); + glVertex2f(left,top+5); - glColor4ub(255,255,255,0); - glVertex2f(left+width-40,top+5); - glVertex2f(left+width-40,top+height); - glColor4ub(255,255,255,255); + //glColor4ub(255,255,255,0); + glVertex2f(left+width,top+5); + glVertex2f(left+width,top+height); + //glColor4ub(255,255,255,255); glVertex2f(left+width+20,top+height); glVertex2f(left+width+20,top+5); glEnd(); diff --git a/daily.cpp b/daily.cpp index 4f0db06d..e41dd0de 100644 --- a/daily.cpp +++ b/daily.cpp @@ -102,7 +102,7 @@ Daily::Daily(QWidget *parent,QGLWidget * shared, MainWindow *mw) SF->AddLayer(AddCPAP(fg)); SF->AddLayer(new gShadowArea()); SF->AddLayer(new gYSpacer(),LayerLeft,gYAxis::Margin); - SF->AddLayer(new gFooBar(),LayerBottom,0,1); + //SF->AddLayer(new gFooBar(),LayerBottom,0,1); SF->AddLayer(new gXAxis(Qt::black,false),LayerBottom,0,gXAxis::Margin); PRD->AddLayer(new gXGrid());