summaryrefslogtreecommitdiff
path: root/wx+/graph.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'wx+/graph.cpp')
-rwxr-xr-xwx+/graph.cpp18
1 files changed, 8 insertions, 10 deletions
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<CurveData>& 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;
bgstack15