mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-08 00:06:51 -05:00
const qgsrectangle
This commit is contained in:
parent
c63c630c16
commit
e7568f24ef
@ -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 ¢er, 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``.
|
||||||
|
|||||||
@ -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 ¢er, 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;
|
||||||
|
|||||||
@ -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 ¢er, double width, double height );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the rectangle from two QgsPoints.
|
* Sets the rectangle from two QgsPoints.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user