Skip to content
Snippets Groups Projects
Commit 612e6ab5 authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

Improve alignment of items after GraphicsScene drag-and-drop

parent 329c7de1
No related branches found
No related tags found
No related merge requests found
......@@ -16,8 +16,18 @@
#include "DesignerScene.h"
#include "IView.h"
#include "SampleModel.h"
#include "StyleUtils.h"
#include <QModelIndex>
namespace {
int step_width() {
return StyleUtils::SizeOfLetterM().width()*12.5;
}
int step_height() {
return StyleUtils::SizeOfLetterM().height()*11;
}
}
SampleViewAligner::SampleViewAligner(DesignerScene* scene) : m_scene(scene)
{
Q_ASSERT(m_scene);
......@@ -166,7 +176,7 @@ void SampleViewAligner::alignSample(const QModelIndex& parentIndex, QPointF refe
QModelIndex itemIndex = sampleModel->index(i_row, 0, parentIndex);
if (!getViewForIndex(itemIndex))
continue;
QPointF child_reference = reference + QPointF(-150, 150 * child_counter++);
QPointF child_reference = reference + QPointF(-step_width(), step_height() * child_counter++);
alignSample(itemIndex, child_reference, force_alignment);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment