diff options
author | B Stack <bgstack15@gmail.com> | 2018-11-15 11:22:00 +0000 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2018-11-15 11:22:00 +0000 |
commit | 77c5c2503d459288720a8894349ac74e5eeec7c6 (patch) | |
tree | 30bf08d782d58174a0ca212b2e4b172fabd9c42c /wx+/graph.cpp | |
parent | Merge branch '10.5' into 'master' (diff) | |
parent | 10.6 (diff) | |
download | FreeFileSync-77c5c2503d459288720a8894349ac74e5eeec7c6.tar.gz FreeFileSync-77c5c2503d459288720a8894349ac74e5eeec7c6.tar.bz2 FreeFileSync-77c5c2503d459288720a8894349ac74e5eeec7c6.zip |
Merge branch '10.6' into 'master'10.6
10.6
See merge request opensource-tracking/FreeFileSync!3
Diffstat (limited to 'wx+/graph.cpp')
-rwxr-xr-x | wx+/graph.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/wx+/graph.cpp b/wx+/graph.cpp index e00bed86..9cacd1bf 100755 --- a/wx+/graph.cpp +++ b/wx+/graph.cpp @@ -91,7 +91,7 @@ public: int realToScreenRound(double realPos) const //returns -1 and screenSize + 1 if out of bounds! { //catch large double values: if double is larger than what int can represent => undefined behavior! - numeric::clamp(realPos, outOfBoundsLow_, outOfBoundsHigh_); + realPos = std::clamp(realPos, outOfBoundsLow_, outOfBoundsHigh_); return numeric::round(realToScreen(realPos)); } @@ -724,10 +724,10 @@ void Graph2D::render(wxDC& dc) const const wxPoint screenCurrent = activeSel_->refCurrentPos() - graphAreaOrigin; //normalize positions: a mouse selection is symmetric and *not* an half-open range! - double screenFromX = numeric::clampCpy(screenStart .x, 0, graphArea.width - 1); - double screenFromY = numeric::clampCpy(screenStart .y, 0, graphArea.height - 1); - double screenToX = numeric::clampCpy(screenCurrent.x, 0, graphArea.width - 1); - double screenToY = numeric::clampCpy(screenCurrent.y, 0, graphArea.height - 1); + double screenFromX = std::clamp(screenStart .x, 0, graphArea.width - 1); + double screenFromY = std::clamp(screenStart .y, 0, graphArea.height - 1); + double screenToX = std::clamp(screenCurrent.x, 0, graphArea.width - 1); + double screenToY = std::clamp(screenCurrent.y, 0, graphArea.height - 1); widen(&screenFromX, &screenToX); //use full pixel range for selection! widen(&screenFromY, &screenToY); @@ -782,10 +782,10 @@ void Graph2D::render(wxDC& dc) const shrink(&screenFromX, &screenToX); shrink(&screenFromY, &screenToY); - numeric::clamp(screenFromX, 0.0, graphArea.width - 1.0); - numeric::clamp(screenFromY, 0.0, graphArea.height - 1.0); - numeric::clamp(screenToX, 0.0, graphArea.width - 1.0); - numeric::clamp(screenToY, 0.0, graphArea.height - 1.0); + screenFromX = std::clamp(screenFromX, 0.0, graphArea.width - 1.0); + screenFromY = std::clamp(screenFromY, 0.0, graphArea.height - 1.0); + screenToX = std::clamp(screenToX, 0.0, graphArea.width - 1.0); + screenToY = std::clamp(screenToY, 0.0, graphArea.height - 1.0); const wxPoint pixelFrom = wxPoint(numeric::round(screenFromX), numeric::round(screenFromY)) + graphAreaOrigin; |