mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[libaxx] add cmath and use cmath instead of math.h when required
Change-Id: Id839b17d33c69e2e002f370e553ff35246a1bc90
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user