mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-21 16:50:53 +01:00
Corrections sur le calcul des positions des champs de texte dynamiques.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@820 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -66,7 +66,7 @@ ElementTextItem::~ElementTextItem() {
|
||||
*/
|
||||
void ElementTextItem::setPos(const QPointF &pos) {
|
||||
QPointF actual_pos = pos;
|
||||
actual_pos -= QPointF(0.0, boundingRect().height() / 2.0);
|
||||
actual_pos -= QPointF(0.0, boundingRect().bottom() / 2.0);
|
||||
QGraphicsTextItem::setPos(actual_pos);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ void ElementTextItem::setPos(qreal x, qreal y) {
|
||||
*/
|
||||
QPointF ElementTextItem::pos() const {
|
||||
QPointF actual_pos = DiagramTextItem::pos();
|
||||
actual_pos += QPointF(0.0, boundingRect().height() / 2.0);
|
||||
actual_pos += QPointF(0.0, boundingRect().bottom() / 2.0);
|
||||
return(actual_pos);
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ void ElementTextItem::adjustItemPosition(int new_block_count) {
|
||||
@param angle Angle de la rotation a effectuer
|
||||
*/
|
||||
void ElementTextItem::applyRotation(const qreal &angle) {
|
||||
qreal origin_offset = boundingRect().height() / 2.0;
|
||||
qreal origin_offset = boundingRect().bottom() / 2.0;
|
||||
|
||||
QTransform rotation;
|
||||
rotation.translate(0.0, origin_offset);
|
||||
|
||||
Reference in New Issue
Block a user