const qgsrectangle

This commit is contained in:
Loïc Bartoletti 2021-09-23 06:38:38 +02:00 committed by Nyall Dawson
parent c63c630c16
commit e7568f24ef
3 changed files with 3 additions and 3 deletions

View File

@ -67,7 +67,7 @@ The WKT must contain only 5 vertices, representing a rectangle aligned with X an
.. versionadded:: 3.0 .. versionadded:: 3.0
%End %End
static QgsRectangle fromCenterAndSize( QgsPointXY center, double width, double height ); static QgsRectangle fromCenterAndSize( const QgsPointXY &center, double width, double height );
%Docstring %Docstring
Creates a new rectangle, given the specified ``center`` point Creates a new rectangle, given the specified ``center`` point
and ``width`` and ``height``. and ``width`` and ``height``.

View File

@ -49,7 +49,7 @@ QgsRectangle QgsRectangle::fromWkt( const QString &wkt )
return QgsRectangle(); return QgsRectangle();
} }
QgsRectangle QgsRectangle::fromCenterAndSize( QgsPointXY center, double width, double height ) QgsRectangle QgsRectangle::fromCenterAndSize( const QgsPointXY &center, double width, double height )
{ {
const double xMin = center.x() - width / 2.0; const double xMin = center.x() - width / 2.0;
const double xMax = xMin + width; const double xMax = xMin + width;

View File

@ -111,7 +111,7 @@ class CORE_EXPORT QgsRectangle
* and \a width and \a height. * and \a width and \a height.
* \since QGIS 3.0 * \since QGIS 3.0
*/ */
static QgsRectangle fromCenterAndSize( QgsPointXY center, double width, double height ); static QgsRectangle fromCenterAndSize( const QgsPointXY &center, double width, double height );
/** /**
* Sets the rectangle from two QgsPoints. * Sets the rectangle from two QgsPoints.