|
@@ -119,6 +119,7 @@ Framework::Zeichnung* QuestGraphElement::parseElement(
|
|
|
}
|
|
|
graph->addVirtualConnectionNodes();
|
|
|
graph->sortItems();
|
|
|
+ graph->fixItemPositions();
|
|
|
return graph;
|
|
|
}
|
|
|
|
|
@@ -137,7 +138,7 @@ void QuestGraphElement::layout(Framework::XML::Element& element,
|
|
|
{
|
|
|
UIMLElement::layout(element, z, pWidth, pHeight, generalLayouter);
|
|
|
QuestGraph* graph = dynamic_cast<QuestGraph*>(&z);
|
|
|
- graph->fixItemPositions();
|
|
|
+ graph->centerVertically();
|
|
|
}
|
|
|
|
|
|
QuestGraphItemElement::QuestGraphItemElement() {}
|
|
@@ -620,7 +621,7 @@ void QuestGraphItem::render(Framework::Bild& rObj)
|
|
|
ZeichnungHintergrund::render(rObj);
|
|
|
if (finished && !rewarded)
|
|
|
{
|
|
|
- if (rObj.setDrawOptions(pos.x, pos.y, gr.x - 1, gr.y - 1))
|
|
|
+ if (rObj.setDrawOptions(pos.x, pos.y, gr.x, gr.y))
|
|
|
{
|
|
|
for (int i = 0; i < 7; i++)
|
|
|
{
|
|
@@ -1242,6 +1243,38 @@ void QuestGraph::fixItemPositions()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void QuestGraph::centerVertically() {
|
|
|
+ int height = 0;
|
|
|
+ for (QuestGraphItemLayer* layer : layers)
|
|
|
+ {
|
|
|
+ if (layer->getLeyerHeight() > height)
|
|
|
+ {
|
|
|
+ height = layer->getLeyerHeight();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (height > getInnenHeight())
|
|
|
+ {
|
|
|
+ addStyle(ZeichnungHintergrund::Style::VScroll);
|
|
|
+ setVertikalKlickScroll(10);
|
|
|
+ vertikalScrollBar->update(height, getInnenHeight());
|
|
|
+ }
|
|
|
+ if (layers.getEintragAnzahl() * 150 - 80 > getInnenBreite())
|
|
|
+ {
|
|
|
+ addStyle(ZeichnungHintergrund::Style::HScroll);
|
|
|
+ setHorizontalKlickScroll(10);
|
|
|
+ horizontalScrollBar->update(
|
|
|
+ layers.getEintragAnzahl() * 150 - 80, getInnenBreite());
|
|
|
+ }
|
|
|
+ QuestGraphItemLayer* last = 0;
|
|
|
+ for (int i = layers.getEintragAnzahl() - 1; i >= 0; i--)
|
|
|
+ {
|
|
|
+ QuestGraphItemLayer* layer = layers.z(i);
|
|
|
+ layer->centerVertically(getHeight() / 2);
|
|
|
+ if (last) layer->resolveHorizontalConflicts(last);
|
|
|
+ last = layer;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
void QuestGraph::addItem(QuestGraphItem* item)
|
|
|
{
|
|
|
int layerInex = item->getLayerIndex();
|