From 9b623ea3943165fe7efb5e47a0b5b9452c1599e6 Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Wed, 9 May 2018 00:09:55 +0200 Subject: 9.8 --- wx+/graph.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'wx+/graph.cpp') diff --git a/wx+/graph.cpp b/wx+/graph.cpp index b81896b4..dbce3769 100755 --- a/wx+/graph.cpp +++ b/wx+/graph.cpp @@ -539,8 +539,6 @@ void Graph2D::addCurve(const std::shared_ptr& data, const CurveAttrib void Graph2D::render(wxDC& dc) const { - using namespace numeric; - //set label font right at the start so that it is considered by wxDC::GetTextExtent() below! dc.SetFont(labelFont_); @@ -722,10 +720,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 = clampCpy(screenStart .x, 0, graphArea.width - 1); - double screenFromY = clampCpy(screenStart .y, 0, graphArea.height - 1); - double screenToX = clampCpy(screenCurrent.x, 0, graphArea.width - 1); - double screenToY = clampCpy(screenCurrent.y, 0, graphArea.height - 1); + 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); widen(&screenFromX, &screenToX); //use full pixel range for selection! widen(&screenFromY, &screenToY); @@ -780,10 +778,10 @@ void Graph2D::render(wxDC& dc) const shrink(&screenFromX, &screenToX); shrink(&screenFromY, &screenToY); - clamp(screenFromX, 0.0, graphArea.width - 1.0); - clamp(screenFromY, 0.0, graphArea.height - 1.0); - clamp(screenToX, 0.0, graphArea.width - 1.0); - clamp(screenToY, 0.0, graphArea.height - 1.0); + 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); const wxPoint pixelFrom = wxPoint(numeric::round(screenFromX), numeric::round(screenFromY)) + graphAreaOrigin; -- cgit