From kde-commits Tue Aug 13 12:35:27 2013 From: Rex Dieter Date: Tue, 13 Aug 2013 12:35:27 +0000 To: kde-commits Subject: branches/work/kst/portto4/kst/src/libkstapp Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=137639734212679 SVN commit 1362914 by rdieter: fix some assumptions that qreal=double, should now be buildable on arm. BUG: 317094 M +1 -1 circleitem.cpp M +10 -10 plotrenderitem.cpp M +4 -4 plotrenderitem.h M +1 -1 view.cpp --- branches/work/kst/portto4/kst/src/libkstapp/circleitem.cpp #1362913:1362914 @@ -70,7 +70,7 @@ const QPolygonF poly = mapFromScene(view()->creationPolygon(View::MouseMove)); qreal dx = poly.last().x(); qreal dy = poly.last().y(); - qreal r = qMax(qreal(2.0),sqrt(dx*dx + dy*dy)); + qreal r = qMax(qreal(2.0),qSqrt(dx*dx + dy*dy)); QRectF newRect(-r, -r, 2.0*r, 2.0*r); setViewRect(newRect); --- branches/work/kst/portto4/kst/src/libkstapp/plotrenderitem.cpp #1362913:1362914 @@ -557,11 +557,11 @@ const QPointF p = event->pos(); - double y = (p.y() - rect().bottom())/(rect().top()-rect().bottom())*(plotItem()->yMax()-plotItem()->yMin())+plotItem()->yMin(); + qreal y = (p.y() - rect().bottom())/(rect().top()-rect().bottom())*(plotItem()->yMax()-plotItem()->yMin())+plotItem()->yMin(); y = qMin(y, plotItem()->yMax()); y = qMax(y, plotItem()->yMin()); - double x = (p.x() - rect().left())/(rect().right()-rect().left())*(plotItem()->xMax()-plotItem()->xMin())+plotItem()->xMin(); + qreal x = (p.x() - rect().left())/(rect().right()-rect().left())*(plotItem()->xMax()-plotItem()->xMin())+plotItem()->xMin(); x = qMin(x, plotItem()->xMax()); x = qMax(x, plotItem()->xMin()); @@ -661,8 +661,8 @@ } } -void PlotRenderItem::hoverYZoomMouseCursor(double y) { - double py; +void PlotRenderItem::hoverYZoomMouseCursor(qreal y) { + qreal py; py = (y-plotItem()->yMin())/(plotItem()->yMax() - plotItem()->yMin())*(rect().top()-rect().bottom()) + rect().bottom(); py = qMin(py, rect().bottom()); @@ -676,8 +676,8 @@ } -void PlotRenderItem::hoverXZoomMouseCursor(double x) { - double px; +void PlotRenderItem::hoverXZoomMouseCursor(qreal x) { + qreal px; px = (x-plotItem()->xMin())/(plotItem()->xMax() - plotItem()->xMin())*(rect().right()-rect().left()) + rect().left(); px = qMax(px, rect().left()); @@ -690,8 +690,8 @@ update(); //FIXME should optimize instead of redrawing entire curve! } -void PlotRenderItem::dragYZoomMouseCursor(double y) { - double py; +void PlotRenderItem::dragYZoomMouseCursor(qreal y) { + qreal py; py = (y-plotItem()->yMin())/(plotItem()->yMax() - plotItem()->yMin())*(rect().top()-rect().bottom()) + rect().bottom(); py = qMin(py, rect().bottom()); @@ -702,8 +702,8 @@ } -void PlotRenderItem::dragXZoomMouseCursor(double x) { - double px; +void PlotRenderItem::dragXZoomMouseCursor(qreal x) { + qreal px; px = (x-plotItem()->xMin())/(plotItem()->xMax() - plotItem()->xMin())*(rect().right()-rect().left()) + rect().left(); px = qMax(px, rect().left()); --- branches/work/kst/portto4/kst/src/libkstapp/plotrenderitem.h #1362913:1362914 @@ -73,11 +73,11 @@ QList sharedOrTiedPlots(bool sharedX, bool sharedY); - void hoverYZoomMouseCursor(double y); - void hoverXZoomMouseCursor(double x); + void hoverYZoomMouseCursor(qreal y); + void hoverXZoomMouseCursor(qreal x); - void dragYZoomMouseCursor(double y); - void dragXZoomMouseCursor(double x); + void dragYZoomMouseCursor(qreal y); + void dragXZoomMouseCursor(qreal x); QPointF statusMessagePoint; public Q_SLOTS: virtual void edit(); --- branches/work/kst/portto4/kst/src/libkstapp/view.cpp #1362913:1362914 @@ -630,7 +630,7 @@ // agressively. The behavior looks pretty good to me with 6. qreal count = qMax(plots.count()-6, 1); - qreal newPointSize = qMax(pointSize/sqrt(count) , ApplicationSettings::self()->minimumFontSize()); + qreal newPointSize = qMax(pointSize/qSqrt(count) , ApplicationSettings::self()->minimumFontSize()); if (newPointSize