Skip to content

Commit b6e1423

Browse files
committed
corrected Ring update
1 parent f2f8a42 commit b6e1423

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

viewer/vibesgraphicsitem.cpp

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,9 +1018,6 @@ bool VibesGraphicsText::parseJsonGraphics(const QJsonObject& json)
10181018
// #define GET_WITH_DEFAULT(dict,key,type,default_value) \
10191019
// dict.contains[key] ? dict[key].type
10201020

1021-
// TO DELETE
1022-
#include <iostream>
1023-
using namespace std;
10241021

10251022
bool VibesGraphicsText::computeProjection(int dimX, int dimY)
10261023
{
@@ -2124,9 +2121,23 @@ bool VibesGraphicsRing::computeProjection(int dimX, int dimY)
21242121
Q_ASSERT(rho[0].toDouble() >= 0);
21252122
Q_ASSERT(rho[1].toDouble() >= rho[0].toDouble());
21262123

2127-
//
2128-
// Body
2124+
// If the shape has already been drawn, it has at least one child
2125+
// Update child items if they exist
2126+
if (this->childItems().size() > 0)
21292127
{
2128+
foreach(QGraphicsItem * item, this->childItems())
2129+
{
2130+
//to vibes graphics item
2131+
QGraphicsPathItem *graphics_path = qgraphicsitem_cast<QGraphicsPathItem *>(item);
2132+
graphics_path->setPen(pen);
2133+
graphics_path->setBrush(brush);
2134+
}
2135+
}
2136+
// Else draw the shape for the first time
2137+
else
2138+
{
2139+
//
2140+
// Body
21302141
double cx = center[0].toDouble();
21312142
double cy = center[1].toDouble();
21322143

0 commit comments

Comments
 (0)