mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-22 01:10:53 +01:00
Les proprietes des elements affichent desormais la position de l'element dans la grille.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@662 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "ghostelement.h"
|
||||
#include "diagramcommands.h"
|
||||
#include "diagramcontent.h"
|
||||
#include "diagramposition.h"
|
||||
|
||||
const int Diagram::xGrid = 10;
|
||||
const int Diagram::yGrid = 10;
|
||||
@@ -896,6 +897,24 @@ bool Diagram::usesElement(const ElementsLocation &location) {
|
||||
return(false);
|
||||
}
|
||||
|
||||
/**
|
||||
@param pos Position cartesienne (ex : 10.3, 45.2) a transformer en position
|
||||
dans la grille (ex : B2)
|
||||
@return la position dans la grille correspondant a pos
|
||||
*/
|
||||
DiagramPosition Diagram::convertPosition(const QPointF &pos) {
|
||||
// decale la position pour prendre en compte les marges en haut a gauche du schema
|
||||
QPointF final_pos = pos - QPointF(margin, margin);
|
||||
|
||||
// delegue le calcul au BorderInset
|
||||
DiagramPosition diagram_position = border_and_inset.convertPosition(final_pos);
|
||||
|
||||
// embarque la position cartesienne
|
||||
diagram_position.setPosition(pos);
|
||||
|
||||
return(diagram_position);
|
||||
}
|
||||
|
||||
/**
|
||||
Definit s'il faut afficher ou non les bornes
|
||||
@param dt true pour afficher les bornes, false sinon
|
||||
|
||||
Reference in New Issue
Block a user