[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,7 +1,7 @@
#include <escher/button_row_controller.h>
#include <escher/palette.h>
#include <assert.h>
#include <math.h>
#include <cmath>
ButtonRowDelegate::ButtonRowDelegate(ButtonRowController * header, ButtonRowController * footer) :
m_header(header),
@@ -85,7 +85,7 @@ void ButtonRowController::ContentView::layoutSubviews() {
Button * button = buttonAtIndex(i);
totalButtonWidth += button->minimalSizeForOptimalDisplay().width();
}
widthMargin = roundf((bounds().width() - totalButtonWidth)/(nbOfButtons+1));
widthMargin = std::round((float)((bounds().width() - totalButtonWidth)/(nbOfButtons+1)));
buttonHeightMargin = k_embossedStyleHeightMargin;
buttonHeight = rowHeight- 2*k_embossedStyleHeightMargin;
}
@@ -131,7 +131,7 @@ void ButtonRowController::ContentView::drawRect(KDContext * ctx, KDRect rect) co
Button * button = buttonAtIndex(i);
totalButtonWidth += button->minimalSizeForOptimalDisplay().width();
}
KDCoordinate widthMargin = roundf((bounds().width() - totalButtonWidth)/(numberOfButtons()+1));
KDCoordinate widthMargin = std::round((float)((bounds().width() - totalButtonWidth)/(numberOfButtons()+1)));
int currentXOrigin = widthMargin-1;
for (int i = 0; i < numberOfButtons(); i++) {