mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-26 04:30:53 +01:00
Correction d'un bug dans la modification des conducteurs apres un deplacement d'elements
Implementation partielle de l'alignement des conducteurs sur la grille. Lors de la modification manuelle des conducteurs, les segments se fixent sur la grille. L'ancien comportement peut etre obtenu en maintenant la touche Shift enfoncee. Optimisation des fonctions "Selectionner tout" et "Deselectionner tout" Remplacement des #define par des attributs static const git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@168 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -11,8 +11,9 @@
|
||||
#include "partarc.h"
|
||||
#include "hotspoteditor.h"
|
||||
#include "editorcommands.h"
|
||||
#define GRILLE_X 10
|
||||
#define GRILLE_Y 10
|
||||
|
||||
const int ElementScene::xGrid = 10;
|
||||
const int ElementScene::yGrid = 10;
|
||||
|
||||
ElementScene::ElementScene(QETElementEditor *editor, QObject *parent) :
|
||||
QGraphicsScene(parent),
|
||||
@@ -248,12 +249,12 @@ void ElementScene::drawBackground(QPainter *p, const QRectF &r) {
|
||||
qreal limite_y = r.y() + r.height();
|
||||
|
||||
int g_x = (int)ceil(r.x());
|
||||
while (g_x % GRILLE_X) ++ g_x;
|
||||
while (g_x % xGrid) ++ g_x;
|
||||
int g_y = (int)ceil(r.y());
|
||||
while (g_y % GRILLE_Y) ++ g_y;
|
||||
while (g_y % yGrid) ++ g_y;
|
||||
|
||||
for (int gx = g_x ; gx < limite_x ; gx += GRILLE_X) {
|
||||
for (int gy = g_y ; gy < limite_y ; gy += GRILLE_Y) {
|
||||
for (int gx = g_x ; gx < limite_x ; gx += xGrid) {
|
||||
for (int gy = g_y ; gy < limite_y ; gy += yGrid) {
|
||||
p -> drawPoint(gx, gy);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,10 @@ class ElementScene : public QGraphicsScene {
|
||||
ElementScene(const ElementScene &);
|
||||
|
||||
// attributs
|
||||
public:
|
||||
static const int xGrid;
|
||||
static const int yGrid;
|
||||
|
||||
private:
|
||||
/// longueur de l'element en dizaines de pixels
|
||||
uint _width;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef PART_TEXT
|
||||
#define PART_TEXT
|
||||
#ifndef PART_TEXT_H
|
||||
#define PART_TEXT_H
|
||||
#include <QtGui>
|
||||
#include "customelementpart.h"
|
||||
class TextEditor;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef PART_TEXTFIELD
|
||||
#define PART_TEXTFIELD
|
||||
#ifndef PART_TEXTFIELD_H
|
||||
#define PART_TEXTFIELD_H
|
||||
#include <QtGui>
|
||||
#include "customelementpart.h"
|
||||
class TextFieldEditor;
|
||||
|
||||
Reference in New Issue
Block a user