mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02:00
BugFix: Flip and Mirror of terminals
This commit is contained in:
parent
5aee30edee
commit
007ce79cee
@ -150,7 +150,7 @@ void PartTerminal::setOrientation(Qet::Orientation ori) {
|
|||||||
prepareGeometryChange();
|
prepareGeometryChange();
|
||||||
d -> m_orientation = ori;
|
d -> m_orientation = ori;
|
||||||
updateSecondPoint();
|
updateSecondPoint();
|
||||||
emit orientationChanged();
|
emit orientationChanged(); // all terminal-signals call "updateForm"
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -180,9 +180,7 @@ void PartTerminal::setRotation(qreal angle) {
|
|||||||
|
|
||||||
setPos(d->m_pos);
|
setPos(d->m_pos);
|
||||||
setOrientation(new_ori);
|
setOrientation(new_ori);
|
||||||
emit xChanged();
|
emit orientationChanged(); // all terminal-signals call "updateForm"
|
||||||
emit yChanged();
|
|
||||||
emit orientationChanged();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal PartTerminal::rotation() const {
|
qreal PartTerminal::rotation() const {
|
||||||
@ -201,37 +199,34 @@ void PartTerminal::flip() {
|
|||||||
switch (d->m_orientation) {
|
switch (d->m_orientation) {
|
||||||
case Qet::North : setOrientation(Qet::South);
|
case Qet::North : setOrientation(Qet::South);
|
||||||
break;
|
break;
|
||||||
case Qet::East : return;
|
case Qet::East : break;
|
||||||
case Qet::South : setOrientation(Qet::North);
|
case Qet::South : setOrientation(Qet::North);
|
||||||
break;
|
break;
|
||||||
case Qet::West : return;
|
case Qet::West : break;
|
||||||
}
|
}
|
||||||
setPos(d->m_pos);
|
setPos(d->m_pos);
|
||||||
updateSecondPoint();
|
updateSecondPoint();
|
||||||
prepareGeometryChange();
|
prepareGeometryChange();
|
||||||
emit yChanged();
|
emit yChanged(); // all terminal-signals call "updateForm"
|
||||||
emit orientationChanged();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PartTerminal::mirror() {
|
void PartTerminal::mirror() {
|
||||||
d->m_pos.setX((-1.0) * d->m_pos.x());
|
d->m_pos.setX((-1.0) * d->m_pos.x());
|
||||||
switch (d->m_orientation) {
|
switch (d->m_orientation) {
|
||||||
case Qet::North : return;
|
case Qet::North : break;
|
||||||
case Qet::East : setOrientation(Qet::West);
|
case Qet::East : setOrientation(Qet::West);
|
||||||
break;
|
break;
|
||||||
case Qet::South : return;
|
case Qet::South : break;
|
||||||
case Qet::West : setOrientation(Qet::East);
|
case Qet::West : setOrientation(Qet::East);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
setPos(d->m_pos);
|
setPos(d->m_pos);
|
||||||
updateSecondPoint();
|
updateSecondPoint();
|
||||||
prepareGeometryChange();
|
prepareGeometryChange();
|
||||||
emit xChanged();
|
emit xChanged(); // all terminal-signals call "updateForm"
|
||||||
emit orientationChanged();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief PartTerminal::setTerminalName
|
@brief PartTerminal::setTerminalName
|
||||||
@param name
|
@param name
|
||||||
@ -239,7 +234,7 @@ void PartTerminal::mirror() {
|
|||||||
void PartTerminal::setTerminalName(const QString& name) {
|
void PartTerminal::setTerminalName(const QString& name) {
|
||||||
if (d -> m_name == name) return;
|
if (d -> m_name == name) return;
|
||||||
d -> m_name = name;
|
d -> m_name = name;
|
||||||
emit nameChanged();
|
emit nameChanged(); // all terminal-signals call "updateForm"
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -253,7 +248,7 @@ void PartTerminal::setTerminalType(TerminalData::Type type)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
d->m_type = type;
|
d->m_type = type;
|
||||||
emit terminalTypeChanged();
|
emit terminalTypeChanged(); // all terminal-signals call "updateForm"
|
||||||
}
|
}
|
||||||
|
|
||||||
void PartTerminal::setNewUuid()
|
void PartTerminal::setNewUuid()
|
||||||
@ -262,6 +257,8 @@ void PartTerminal::setNewUuid()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Updates the position of the second point according to the position
|
||||||
|
and orientation of the terminal.
|
||||||
Met a jour la position du second point en fonction de la position et de
|
Met a jour la position du second point en fonction de la position et de
|
||||||
l'orientation de la borne.
|
l'orientation de la borne.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user