Commit 4e91d7d0 authored by Ralf Habacker's avatar Ralf Habacker
Browse files

Fix resolution of origin in layout generator

CCBUG:414595
parent 9baf784b
...@@ -266,7 +266,7 @@ bool LayoutGenerator::apply(UMLScene *scene) ...@@ -266,7 +266,7 @@ bool LayoutGenerator::apply(UMLScene *scene)
continue; continue;
if (widget->isPortWidget() || widget->isPinWidget()) if (widget->isPortWidget() || widget->isPinWidget())
continue; continue;
QPoint p = origin(id); QPointF p = origin(id);
widget->setStartMovePosition(widget->pos()); widget->setStartMovePosition(widget->pos());
widget->setX(p.x()); widget->setX(p.x());
widget->setY(p.y()-widget->height()); widget->setY(p.y()-widget->height());
...@@ -330,7 +330,7 @@ bool LayoutGenerator::availableConfigFiles(UMLScene *scene, QHash<QString,QStrin ...@@ -330,7 +330,7 @@ bool LayoutGenerator::availableConfigFiles(UMLScene *scene, QHash<QString,QStrin
* @param id The widget id to fetch the origin from * @param id The widget id to fetch the origin from
* @return QPoint instance with the coordinates * @return QPoint instance with the coordinates
*/ */
QPoint LayoutGenerator::origin(const QString &id) QPointF LayoutGenerator::origin(const QString &id)
{ {
QString key = fixID(id); QString key = fixID(id);
if (!m_nodes.contains(key)) { if (!m_nodes.contains(key)) {
...@@ -340,7 +340,7 @@ QPoint LayoutGenerator::origin(const QString &id) ...@@ -340,7 +340,7 @@ QPoint LayoutGenerator::origin(const QString &id)
return QPoint(0,0); return QPoint(0,0);
} }
QRectF &r = m_nodes[key]; QRectF &r = m_nodes[key];
QPoint p(m_origin.x() + r.x() - r.width()/2, m_boundingRect.height() - r.y() + r.height()/2 + m_origin.y()); QPointF p(m_origin.x() + r.x() - r.width()/2, m_boundingRect.height() - r.y() + r.height()/2 + m_origin.y());
#ifdef LAYOUTGENERATOR_DATA_DEBUG #ifdef LAYOUTGENERATOR_DATA_DEBUG
uDebug() << r << p; uDebug() << r << p;
#endif #endif
......
...@@ -50,7 +50,7 @@ public: ...@@ -50,7 +50,7 @@ public:
bool generate(UMLScene *scene, const QString &variant = QString()); bool generate(UMLScene *scene, const QString &variant = QString());
bool apply(UMLScene *scene); bool apply(UMLScene *scene);
static bool availableConfigFiles(UMLScene *scene, QHash<QString,QString> &configFiles); static bool availableConfigFiles(UMLScene *scene, QHash<QString,QString> &configFiles);
QPoint origin(const QString &id); QPointF origin(const QString &id);
bool readGeneratedDotFile(const QString &fileName); bool readGeneratedDotFile(const QString &fileName);
bool parseLine(const QString &line); bool parseLine(const QString &line);
bool splitParameters(QMap<QString,QStringList> &map, const QString &s); bool splitParameters(QMap<QString,QStringList> &map, const QString &s);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment