[TechDraw] Use function overloadin and avoid code repeat

This commit is contained in:
Benjamin Bræstrup Sayoc
2022-07-06 18:01:43 +02:00
committed by WandererFan
parent 91f84184bf
commit 8b52db90c5
8 changed files with 8 additions and 23 deletions

View File

@@ -51,12 +51,7 @@ QGCustomRect::QGCustomRect()
void QGCustomRect::centerAt(QPointF centerPos)
{
QRectF box = boundingRect();
double width = box.width();
double height = box.height();
double newX = centerPos.x() - width/2.;
double newY = centerPos.y() - height/2.;
setPos(newX,newY);
centerAt(centerPos.x(), centerPos.y());
}
void QGCustomRect::centerAt(double cX, double cY)