diff options
author | B Stack <bgstack15@gmail.com> | 2019-05-12 16:34:13 -0400 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2019-05-12 16:34:13 -0400 |
commit | f43972d665c95b2148636c86a5b648e719901101 (patch) | |
tree | b873b15f50a981aacf8bb49fd646bfded2e7a73b /wx+/graph.cpp | |
parent | Merge branch '10.11' into 'master' (diff) | |
download | FreeFileSync-f43972d665c95b2148636c86a5b648e719901101.tar.gz FreeFileSync-f43972d665c95b2148636c86a5b648e719901101.tar.bz2 FreeFileSync-f43972d665c95b2148636c86a5b648e719901101.zip |
10.12
Diffstat (limited to 'wx+/graph.cpp')
-rw-r--r-- | wx+/graph.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/wx+/graph.cpp b/wx+/graph.cpp index 9cacd1bf..3df8888a 100644 --- a/wx+/graph.cpp +++ b/wx+/graph.cpp @@ -621,10 +621,10 @@ void Graph2D::render(wxDC& dc) const maxX = std::max(maxX, rangeX.second); } - const wxSize minimalBlockSizePx = dc.GetTextExtent(L"00"); - if (minX <= maxX && maxX - minX < std::numeric_limits<double>::infinity()) //valid x-range { + const wxSize minimalBlockSizePx = dc.GetTextExtent(L"00"); + int blockCountX = 0; //enlarge minX, maxX to a multiple of a "useful" block size if (attr_.labelposX != LABEL_X_NONE && attr_.labelFmtX.get()) @@ -675,7 +675,9 @@ void Graph2D::render(wxDC& dc) const minimalBlockSizePx.GetHeight() * 3, *attr_.labelFmtY); - if (graphArea.width <= 1 || graphArea.height <= 1) return; + if (graphArea.width <= 1 || graphArea.height <= 1) + return; + const ConvertCoord cvrtX(minX, maxX, graphArea.width - 1); //map [minX, maxX] to [0, pixelWidth - 1] const ConvertCoord cvrtY(maxY, minY, graphArea.height - 1); //map [minY, maxY] to [pixelHeight - 1, 0] @@ -710,7 +712,7 @@ void Graph2D::render(wxDC& dc) const } //update active mouse selection - if (activeSel_.get() && graphArea.width > 0 && graphArea.height > 0) + if (activeSel_) { auto widen = [](double* low, double* high) { |