mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 16:20:52 +01:00
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:
@@ -154,12 +154,8 @@ 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.isNull(), "Conducer::priv_modifieConducer", "pas de profil utilisable");
|
||||
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
|
||||
QPointF new_p1 = mapFromScene(p1);
|
||||
|
||||
@@ -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()));
|
||||
}
|
||||
|
||||
|
||||
24
element.cpp
24
element.cpp
@@ -264,18 +264,20 @@ void Element::moveOtherElements(const QPointF &diff) {
|
||||
|
||||
void Element::mouseReleaseEvent(QGraphicsSceneMouseEvent *e) {
|
||||
Diagram *diagram_ptr = diagram();
|
||||
if (diagram_ptr && !diagram_ptr -> current_movement.isNull()) {
|
||||
diagram_ptr -> undoStack().push(
|
||||
new MoveElementsCommand(
|
||||
diagram_ptr,
|
||||
diagram_ptr -> elementsToMove(),
|
||||
diagram_ptr -> conducersToMove(),
|
||||
diagram_ptr -> conducersToUpdate(),
|
||||
diagram_ptr -> current_movement
|
||||
)
|
||||
);
|
||||
if (diagram_ptr) {
|
||||
if (!diagram_ptr -> current_movement.isNull()) {
|
||||
diagram_ptr -> undoStack().push(
|
||||
new MoveElementsCommand(
|
||||
diagram_ptr,
|
||||
diagram_ptr -> elementsToMove(),
|
||||
diagram_ptr -> conducersToMove(),
|
||||
diagram_ptr -> conducersToUpdate(),
|
||||
diagram_ptr -> current_movement
|
||||
)
|
||||
);
|
||||
diagram_ptr -> current_movement = QPointF();
|
||||
}
|
||||
diagram_ptr -> invalidateMovedElements();
|
||||
diagram_ptr -> current_movement = QPointF();
|
||||
}
|
||||
QGraphicsItem::mouseReleaseEvent(e);
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user