Commit 8eeb0ef6 authored by Alexander A. Maly's avatar Alexander A. Maly

Added QMutex declaration to drawview

parent b04217d8
Pipeline #2825 passed with stages
in 3 minutes and 49 seconds
#include "drawview.h"
#include "drawmodule.h"
#include <QMutex>
#include <QGraphicsItem>
#include <QMouseEvent>
#include <QScrollBar>
#include <QLabel>
#include <QDebug>
......@@ -157,37 +159,27 @@ void DrawView::setNet()
DRAW->setNetStepX(stepX);
DRAW->setNetStepY(stepY);
DRAW->drawNet();
}
DRAW->setNetStepX(stepX);
DRAW->setNetStepY(stepY);
lastStep = stepX;
qDebug() << "c_scale" << c_scale << "NetStep" << DRAW->NetStepX() << "PPC" << pixel_per_cell;
update();
} else {
double pixel_per_cell = DRAW->NetStepX() / (1 / c_scale);
//if(!net)pixel_per_cell=lastStep/(1/c_scale);
if (pixel_per_cell < 15) { //Net step too short
net = false;
smallNetLabel->show();
// lastStep=DRAW->NetStepX();
} else {
if (pixel_per_cell > 15 && !net && pixel_per_cell < this->width() * 2) {
net = true;
smallNetLabel->hide();
// DRAW->setNetStepX(lastStep);
// DRAW->setNetStepY(lastStep);
}
if (pixel_per_cell > this->width() * 2) {
net = false;
}
}
}
};
}
void DrawView::wheelEvent(QWheelEvent *event)
{
......
......@@ -2,8 +2,8 @@
#define DRAWVIEW_H
#include <QGraphicsView>
#include <QLabel>
class QLabel;
class QMutex;
namespace ActorDraw
{
......@@ -42,13 +42,12 @@ protected:
private:
DrawModule *DRAW;
QMutex *dr_mutex;
double c_scale;
bool pressed;
bool net;
QPoint press_pos;
bool firstResize;
double lastStep;
QMutex *dr_mutex;
QLabel *smallNetLabel;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment