diff --git a/src/frontend/wdisp/windisp.c b/src/frontend/wdisp/windisp.c index e3aeb4c86..72461e0a4 100644 --- a/src/frontend/wdisp/windisp.c +++ b/src/frontend/wdisp/windisp.c @@ -558,7 +558,6 @@ LRESULT CALLBACK PlotWindowProc(HWND hwnd, UINT uMsg, case WM_LBUTTONUP: { GRAPH *gr = pGraph(hwnd); - InvalidateRect (hwnd, NULL, TRUE); xe = LOWORD (lParam); ye = HIWORD (lParam); WIN_ScreentoData(gr, xe, ye, &fxe, &fye); @@ -578,6 +577,8 @@ LRESULT CALLBACK PlotWindowProc(HWND hwnd, UINT uMsg, } else { /* need to print info about two points */ + /* trigger re-plotting the graph to get rid of the coordinate rectangle */ + InvalidateRect (hwnd, NULL, TRUE); fprintf(stdout, "\nx0 = %g, y0 = %g x1 = %g, y1 = %g\n", fx0, fy0, fxe, fye); fprintf(stdout, "dx = %g, dy = %g\n", fxe-fx0, fye - fy0); @@ -611,7 +612,6 @@ LRESULT CALLBACK PlotWindowProc(HWND hwnd, UINT uMsg, case WM_RBUTTONUP: { GRAPH *gr = pGraph(hwnd); - InvalidateRect (hwnd, NULL, TRUE); xe = LOWORD (lParam); ye = HIWORD (lParam); /* do nothing if mouse curser is not moved in both x and y */ @@ -619,6 +619,9 @@ LRESULT CALLBACK PlotWindowProc(HWND hwnd, UINT uMsg, SetFocus(swString); goto WIN_DEFAULT; } + /* trigger re-plotting the graph to get rid of the coordinate rectangle */ + InvalidateRect(hwnd, NULL, TRUE); + WIN_ScreentoData(gr, xe, ye, &fxe, &fye); strncpy(buf2, gr->plotname, sizeof(buf2));