mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix compile time warnings
Plus some small whitespace fixes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2e4dcba009
commit
09d08ddc1c
3 changed files with 16 additions and 14 deletions
|
@ -161,7 +161,8 @@ qreal DiveCartesianAxis::posAtValue(qreal value)
|
||||||
QPointF p = pos();
|
QPointF p = pos();
|
||||||
|
|
||||||
double size = max - min;
|
double size = max - min;
|
||||||
double distanceFromOrigin = value - min;
|
// unused for now:
|
||||||
|
// double distanceFromOrigin = value - min;
|
||||||
double percent = (value - min) / size;
|
double percent = (value - min) / size;
|
||||||
|
|
||||||
double realSize = orientation == LeftToRight || orientation == RightToLeft?
|
double realSize = orientation == LeftToRight || orientation == RightToLeft?
|
||||||
|
@ -169,9 +170,8 @@ qreal DiveCartesianAxis::posAtValue(qreal value)
|
||||||
m.y2() - m.y1();
|
m.y2() - m.y1();
|
||||||
|
|
||||||
// Inverted axis, just invert the percentage.
|
// Inverted axis, just invert the percentage.
|
||||||
if(orientation == RightToLeft || orientation == BottomToTop){
|
if (orientation == RightToLeft || orientation == BottomToTop)
|
||||||
percent = 1 - percent;
|
percent = 1 - percent;
|
||||||
}
|
|
||||||
|
|
||||||
double retValue = realSize * percent;
|
double retValue = realSize * percent;
|
||||||
double adjusted =
|
double adjusted =
|
||||||
|
@ -275,9 +275,11 @@ void DiveCartesianPlane::setup()
|
||||||
|
|
||||||
// This creates a Grid around the axis, creating the cartesian plane.
|
// This creates a Grid around the axis, creating the cartesian plane.
|
||||||
const int top = leftAxis->posAtValue(leftAxis->minimum());
|
const int top = leftAxis->posAtValue(leftAxis->minimum());
|
||||||
const int bottom = leftAxis->posAtValue(leftAxis->maximum());
|
// unused for now:
|
||||||
|
// const int bottom = leftAxis->posAtValue(leftAxis->maximum());
|
||||||
const int left = bottomAxis->posAtValue(bottomAxis->minimum());
|
const int left = bottomAxis->posAtValue(bottomAxis->minimum());
|
||||||
const int right = bottomAxis->posAtValue(bottomAxis->maximum());
|
// unused for now:
|
||||||
|
// const int right = bottomAxis->posAtValue(bottomAxis->maximum());
|
||||||
|
|
||||||
setRect(0, 0, horizontalSize, verticalSize);
|
setRect(0, 0, horizontalSize, verticalSize);
|
||||||
setPos(left, top);
|
setPos(left, top);
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
DiveEventItem::DiveEventItem(QObject* parent): DivePixmapItem(parent),
|
DiveEventItem::DiveEventItem(QObject* parent): DivePixmapItem(parent),
|
||||||
vAxis(NULL), hAxis(NULL), internalEvent(NULL), dataModel(NULL)
|
vAxis(NULL), hAxis(NULL), dataModel(NULL), internalEvent(NULL)
|
||||||
{
|
{
|
||||||
setFlag(ItemIgnoresTransformations);
|
setFlag(ItemIgnoresTransformations);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,8 +27,8 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) :
|
||||||
stateMachine(new QStateMachine(this)),
|
stateMachine(new QStateMachine(this)),
|
||||||
background (new DivePixmapItem()),
|
background (new DivePixmapItem()),
|
||||||
profileYAxis(new DepthAxis()),
|
profileYAxis(new DepthAxis()),
|
||||||
temperatureAxis(new TemperatureAxis()),
|
|
||||||
gasYAxis(new DiveCartesianAxis()),
|
gasYAxis(new DiveCartesianAxis()),
|
||||||
|
temperatureAxis(new TemperatureAxis()),
|
||||||
timeAxis(new TimeAxis()),
|
timeAxis(new TimeAxis()),
|
||||||
depthController(new DiveRectItem()),
|
depthController(new DiveRectItem()),
|
||||||
timeController(new DiveRectItem()),
|
timeController(new DiveRectItem()),
|
||||||
|
|
Loading…
Add table
Reference in a new issue