[libaxx] add cmath and use cmath instead of math.h when required

Change-Id: Id839b17d33c69e2e002f370e553ff35246a1bc90
This commit is contained in:
Émilie Feral
2017-08-07 11:47:47 +02:00
parent 9f0bbe0e75
commit 1964d61fdc
111 changed files with 377 additions and 303 deletions

View File

@@ -1,4 +1,5 @@
#include "graph_controller.h"
#include <cmath>
using namespace Shared;
@@ -45,14 +46,14 @@ bool GraphController::handleEnter() {
}
bool GraphController::moveCursorHorizontally(int direction) {
float xCursorPosition = roundf(m_cursor->x());
float xCursorPosition = std::round(m_cursor->x());
if (direction < 0 && xCursorPosition <= 0) {
return false;
}
/* The cursor moves by step of at minimum 1. If the windowRange is to large
* compared to the resolution, the cursor takes bigger round step to cross
* the window in approximatively resolution steps. */
float step = ceilf((interactiveCurveViewRange()->xMax()-interactiveCurveViewRange()->xMin())/m_view.resolution());
float step = std::ceil((interactiveCurveViewRange()->xMax()-interactiveCurveViewRange()->xMin())/m_view.resolution());
step = step < 1.0f ? 1.0f : step;
float x = direction > 0 ? xCursorPosition + step:
xCursorPosition - step;
@@ -68,7 +69,7 @@ bool GraphController::moveCursorHorizontally(int direction) {
}
void GraphController::initCursorParameters() {
float x = roundf((interactiveCurveViewRange()->xMin()+interactiveCurveViewRange()->xMax())/2.0f);
float x = std::round((interactiveCurveViewRange()->xMin()+interactiveCurveViewRange()->xMax())/2.0f);
m_indexFunctionSelectedByCursor = 0;
TextFieldDelegateApp * myApp = (TextFieldDelegateApp *)app();
int functionIndex = 0;