@@ -80,9 +80,10 @@ void OutputWidget::drawItem(Settings data){
80
80
font.setPointSize (1 );
81
81
82
82
// Compiler forced me to declare these up here for some reason
83
- QRectF bRect;
84
- double dx;
85
- double dy;
83
+ QPointF origin;
84
+ QRectF bRect;
85
+ qreal dx;
86
+ qreal dy;
86
87
87
88
Settings::Type name = data.itemType ;
88
89
@@ -101,8 +102,9 @@ void OutputWidget::drawItem(Settings data){
101
102
m_item->setScale (data.scale );
102
103
103
104
// Translate item center-point to scene origin
104
- dx = 0.0 - (m_item->boundingRect ().center ().x ());
105
- dy = 0.0 - (m_item->boundingRect ().center ().y ());
105
+ origin = m_item->mapFromScene (0.0 , 0.0 );
106
+ dx = origin.x () - (m_item->boundingRect ().center ().x ());
107
+ dy = origin.y () - (m_item->boundingRect ().center ().y ());
106
108
m_item->moveBy (dx, dy);
107
109
108
110
// Re-assign item origin used for transformations
@@ -134,11 +136,12 @@ void OutputWidget::drawItem(Settings data){
134
136
bRect = QRectF (0.0 , 0.0 , data.size , data.size );
135
137
136
138
// Create an Ellipse bounded by the QRectF and add to scene
137
- m_item = m_scene->addEllipse (bRect, pen, QBrush (Qt::SolidPattern ));
139
+ m_item = m_scene->addEllipse (bRect, pen, pen. brush ( ));
138
140
139
141
// Translate item center-point to scene origin
140
- dx = 0.0 - (m_item->boundingRect ().center ().x ());
141
- dy = 0.0 - (m_item->boundingRect ().center ().y ());
142
+ origin = m_item->mapFromScene (0.0 , 0.0 );
143
+ dx = origin.x () - (m_item->boundingRect ().center ().x ());
144
+ dy = origin.y () - (m_item->boundingRect ().center ().y ());
142
145
m_item->moveBy (dx, dy);
143
146
144
147
// Translate item center-point to input coordinates
0 commit comments