mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-02 23:20:20 +00:00
d0beae59f9
The chart items were laid out in relative terms with respect to a fixed scene size (100.0, 100.0). This simply does not cut it when resizing the chart. Why should the axes always occupy the same fraction of the chart independent of the size. Moreover, this led to basically unmaintainable code. Resize the scene according to the viewport and do absolute placement of the items. This breaks the layout, but at least now we have a chance to fix things somewhat reasonably. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
29 lines
671 B
C++
29 lines
671 B
C++
// SPDX-License-Identifier: GPL-2.0
|
|
#ifndef TANKITEM_H
|
|
#define TANKITEM_H
|
|
|
|
#include "profile-widget/divelineitem.h"
|
|
#include "core/gas.h"
|
|
#include <QGraphicsRectItem>
|
|
#include <QBrush>
|
|
|
|
struct dive;
|
|
class DiveCartesianAxis;
|
|
|
|
class TankItem : public QGraphicsRectItem
|
|
{
|
|
public:
|
|
explicit TankItem(const DiveCartesianAxis &axis, double dpr);
|
|
void setData(const struct plot_info *plotInfo, const struct dive *d);
|
|
double height() const;
|
|
|
|
private:
|
|
void createBar(int startTime, int stopTime, struct gasmix gas);
|
|
const DiveCartesianAxis &hAxis;
|
|
int plotEndTime;
|
|
double dpr;
|
|
QBrush air, nitrox, oxygen, trimix;
|
|
QList<QGraphicsRectItem *> rects;
|
|
};
|
|
|
|
#endif // TANKITEM_H
|