PKGBUILDs/community/ams/02-armel_minmaxfix.patch
2013-11-25 21:05:02 +00:00

91 lines
4.1 KiB
Diff

Author: Peter Green <plugwash@p10link.net>
Description: Fix FTBFS on armel.
Bug-Debian: http://bugs.debian.org/570848
Bug: https://sourceforge.net/tracker/?func=detail&aid=2959277&group_id=69130&atid=523503
Forwarded: yes
---
src/canvasfunction.cpp | 24 ++++++++++++------------
src/function.cpp | 4 ++--
2 files changed, 14 insertions(+), 14 deletions(-)
--- ams.orig/src/canvasfunction.cpp
+++ ams/src/canvasfunction.cpp
@@ -34,10 +34,10 @@ void CanvasFunction::mouseMoveEvent(int
qreal x = event->scenePos().x();
qreal y = event->scenePos().y();
- x = std::min(x, 5.0 * FUNCTION_SCALE);
- x = std::max(x, -5.0 * FUNCTION_SCALE);
- y = std::min(y, 5.0 * FUNCTION_SCALE);
- y = std::max(y, -5.0 * FUNCTION_SCALE);
+ x = std::min(x, (qreal)(5.0 * FUNCTION_SCALE));
+ x = std::max(x, (qreal)(-5.0 * FUNCTION_SCALE));
+ y = std::min(y, (qreal)(5.0 * FUNCTION_SCALE));
+ y = std::max(y, (qreal)(-5.0 * FUNCTION_SCALE));
switch (*function.mode) {
case 0:
@@ -58,8 +58,8 @@ void CanvasFunction::mouseMoveEvent(int
for (int _p = 0; _p < function.pointCount; ++_p) {
QPointF newPos = canvasPoints.at(_p)->scenePos();
newPos.setX(newPos.x() + delta);
- newPos.setX(std::min(newPos.x(), 5.0 * FUNCTION_SCALE));
- newPos.setX(std::max(newPos.x(), -5.0 * FUNCTION_SCALE));
+ newPos.setX(std::min(newPos.x(), (qreal)(5.0 * FUNCTION_SCALE)));
+ newPos.setX(std::max(newPos.x(), (qreal)(-5.0 * FUNCTION_SCALE)));
setPoint(_p, newPos);
}
} break;
@@ -69,8 +69,8 @@ void CanvasFunction::mouseMoveEvent(int
for (int _p = 0; _p < function.pointCount; ++_p) {
QPointF newPos = canvasPoints.at(_p)->scenePos();
newPos.setY(newPos.y() + delta);
- newPos.setY(std::min(newPos.y(), 5.0 * FUNCTION_SCALE));
- newPos.setY(std::max(newPos.y(), -5.0 * FUNCTION_SCALE));
+ newPos.setY(std::min(newPos.y(), (qreal)(5.0 * FUNCTION_SCALE)));
+ newPos.setY(std::max(newPos.y(), (qreal)(-5.0 * FUNCTION_SCALE)));
setPoint(_p, newPos);
}
} break;
@@ -80,8 +80,8 @@ void CanvasFunction::mouseMoveEvent(int
for (int _p = 0; _p < function.pointCount; ++_p) {
QPointF newPos = canvasPoints.at(_p)->scenePos();
newPos.setX(pos0[_p].x() * delta);
- newPos.setX(std::min(newPos.x(), 5.0 * FUNCTION_SCALE));
- newPos.setX(std::max(newPos.x(), -5.0 * FUNCTION_SCALE));
+ newPos.setX(std::min(newPos.x(), (qreal)(5.0 * FUNCTION_SCALE)));
+ newPos.setX(std::max(newPos.x(), (qreal)(-5.0 * FUNCTION_SCALE)));
setPoint(_p, newPos);
}
} break;
@@ -91,8 +91,8 @@ void CanvasFunction::mouseMoveEvent(int
for (int _p = 0; _p < function.pointCount; ++_p) {
QPointF newPos = canvasPoints.at(_p)->scenePos();
newPos.setY(pos0[_p].y() * delta);
- newPos.setY(std::min(newPos.y(), 5.0 * FUNCTION_SCALE));
- newPos.setY(std::max(newPos.y(), -5.0 * FUNCTION_SCALE));
+ newPos.setY(std::min(newPos.y(), (qreal)(5.0 * FUNCTION_SCALE)));
+ newPos.setY(std::max(newPos.y(), (qreal)(-5.0 * FUNCTION_SCALE)));
setPoint(_p, newPos);
}
} break;
--- ams.orig/src/function.cpp
+++ ams/src/function.cpp
@@ -144,7 +144,7 @@ void Function::drawBackground(QPainter *
{
qreal y = ceil(rect.topLeft().y() * zoom / FUNCTION_SCALE);
y *= FUNCTION_SCALE / zoom;
- QLineF l(std::max(-5.0 * FUNCTION_SCALE, rect.topLeft().x()), y, std::min(5.0 * FUNCTION_SCALE, rect.topRight().x()), y);
+ QLineF l(std::max((qreal)(-5.0 * FUNCTION_SCALE), rect.topLeft().x()), y, std::min((qreal)(5.0 * FUNCTION_SCALE), rect.topRight().x()), y);
while (l.y1() < rect.bottomLeft().y()) {
painter->drawLine(l);
painter->drawText(l.p1(), s.setNum(l.y1() / FUNCTION_SCALE));
@@ -154,7 +154,7 @@ void Function::drawBackground(QPainter *
{
qreal x = ceil(rect.topLeft().x() * zoom / FUNCTION_SCALE);
x *= FUNCTION_SCALE / zoom;
- QLineF l(x, std::max(-5.0 * FUNCTION_SCALE, rect.topLeft().y()), x, std::min(5.0 * FUNCTION_SCALE, rect.bottomLeft().y()));
+ QLineF l(x, std::max((qreal)(-5.0 * FUNCTION_SCALE), rect.topLeft().y()), x, std::min((qreal)(5.0 * FUNCTION_SCALE), rect.bottomLeft().y()));
while (l.x1() < rect.bottomRight().x()) {
painter->drawLine(l);
painter->drawText(l.p1(), s.setNum(l.x1() / FUNCTION_SCALE));