ui: graph transitions
This change adds animated transitions to the QtGraphView using sequential and parallel animations. First vanishing nodes and all edges get faded out, then the remaining nodes are moved and resized, lastly new nodes and all edges are faded in. fortune cookie message = Sorge dich nicht! Du wirst bekommen, was du brauchst.
This commit is contained in:
@@ -66,8 +66,11 @@ void QtGraphPostprocessor::doPostprocessing(std::list<std::shared_ptr<QtGraphNod
|
||||
|
||||
void QtGraphPostprocessor::allignNodeOnRaster(QtGraphNode* node)
|
||||
{
|
||||
Vec2i position = node->getPosition();
|
||||
node->setPosition(alignOnRaster(node->getPosition()));
|
||||
}
|
||||
|
||||
Vec2i QtGraphPostprocessor::alignOnRaster(Vec2i position)
|
||||
{
|
||||
int rasterPosDivisor = s_cellSize + s_cellPadding;
|
||||
|
||||
if(position.x % rasterPosDivisor != 0)
|
||||
@@ -110,7 +113,7 @@ void QtGraphPostprocessor::allignNodeOnRaster(QtGraphNode* node)
|
||||
position.y = t * rasterPosDivisor;
|
||||
}
|
||||
|
||||
node->setPosition(position);
|
||||
return position;
|
||||
}
|
||||
|
||||
void QtGraphPostprocessor::resolveOutliers(std::list<std::shared_ptr<QtGraphNode>>& nodes, const Vec2i& centerPoint)
|
||||
|
||||
Reference in New Issue
Block a user