Correction d'un bug lors du deplacement d'elements

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@149 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavierqet
2007-09-30 14:20:38 +00:00
parent e6fc33f2bd
commit 7aa903c7a4
4 changed files with 17 additions and 18 deletions

View File

@@ -154,11 +154,7 @@ void Conducer::segmentsToPath() {
@param o2 Orientation de la borne 2
*/
void Conducer::priv_modifieConducer(const QPointF &p1, QET::Orientation, const QPointF &p2, QET::Orientation) {
// determine le nombre de segments horizontaux et verticaux
uint nb_horiz_segments = conducer_profile.nbSegments(QET::Horizontal);
uint nb_verti_segments = conducer_profile.nbSegments(QET::Vertical);
Q_ASSERT_X(nb_horiz_segments + nb_verti_segments > 1, "Conducer::priv_modifieConducer", "pas de points a modifier");
Q_ASSERT_X(conducer_profile.nbSegments(QET::Both) > 1, "Conducer::priv_modifieConducer", "pas de points a modifier");
Q_ASSERT_X(!conducer_profile.isNull(), "Conducer::priv_modifieConducer", "pas de profil utilisable");
// recupere les coordonnees fournies des bornes

View File

@@ -22,6 +22,7 @@ Diagram::Diagram(QObject *parent) : QGraphicsScene(parent), qgi_manager(this) {
conducer_setter -> setLine(QLineF(QPointF(0.0, 0.0), QPointF(0.0, 0.0)));
draw_grid = true;
use_border = true;
moved_elements_fetched = false;
connect(this, SIGNAL(selectionChanged()), this, SLOT(slot_checkSelectionEmptinessChange()));
}

View File

@@ -264,7 +264,8 @@ void Element::moveOtherElements(const QPointF &diff) {
void Element::mouseReleaseEvent(QGraphicsSceneMouseEvent *e) {
Diagram *diagram_ptr = diagram();
if (diagram_ptr && !diagram_ptr -> current_movement.isNull()) {
if (diagram_ptr) {
if (!diagram_ptr -> current_movement.isNull()) {
diagram_ptr -> undoStack().push(
new MoveElementsCommand(
diagram_ptr,
@@ -274,9 +275,10 @@ void Element::mouseReleaseEvent(QGraphicsSceneMouseEvent *e) {
diagram_ptr -> current_movement
)
);
diagram_ptr -> invalidateMovedElements();
diagram_ptr -> current_movement = QPointF();
}
diagram_ptr -> invalidateMovedElements();
}
QGraphicsItem::mouseReleaseEvent(e);
}

View File

@@ -6,7 +6,7 @@
</names>
<description>
<polygon x1="-7.5" y1="-13" x2="7.5" y2="-13" x3="0" y3="0" antialias="true" style="filling:white;" />
<line x1="0" y1="0" x2="0" y2="13" antialias="false" />
<line x1="0" y1="0" x2="0" y2="15" antialias="false" />
<terminal orientation="s" x="0" y="15" />
</description>
</definition>