Skip to content

Commit 954d62f

Browse files
committed
Update SIP for fixedAspectRatio in SVG marker
1 parent 48514d2 commit 954d62f

File tree

3 files changed

+46
-6
lines changed

3 files changed

+46
-6
lines changed

python/core/symbology/qgsmarkersymbollayer.sip

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,23 +522,64 @@ Constructs SVG marker symbol layer with picture from given absolute path to a SV
522522

523523
QString path() const;
524524
%Docstring
525+
Returns the marker SVG path.
526+
.. seealso:: setPath()
525527
:rtype: str
526528
%End
529+
527530
void setPath( const QString &path );
531+
%Docstring
532+
Set the marker SVG path.
533+
\param path SVG path
534+
.. seealso:: path()
535+
%End
528536

529537
double defaultAspectRatio() const;
530538
%Docstring
539+
Returns the default marker aspect ratio between width and height, 0 if not yet calculated.
540+
.. seealso:: updateDefaultAspectRatio()
531541
:rtype: float
532542
%End
543+
533544
double updateDefaultAspectRatio();
534545
%Docstring
546+
Calculates the default marker aspect ratio between width and height.
547+
:return: the default aspect ratio value
548+
.. seealso:: defaultAspectRatio()
535549
:rtype: float
536550
%End
551+
552+
bool preservedAspectRatio() const;
553+
%Docstring
554+
Returns the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0.
555+
.. seealso:: setPreservedAspectRatio()
556+
:rtype: bool
557+
%End
558+
559+
bool setPreservedAspectRatio( bool par );
560+
%Docstring
561+
Set preserved the marker aspect ratio between width and height.
562+
\param par Preserved Aspect Ratio
563+
:return: the preserved aspect ratio value, true if fixed aspect ratio has been lower or equal to 0
564+
.. seealso:: preservedAspectRatio()
565+
:rtype: bool
566+
%End
567+
537568
double fixedAspectRatio() const;
538569
%Docstring
570+
Returns the marker aspect ratio between width and height to be used in rendering,
571+
if the value set is lower or equal to 0 the aspect ratio will be preserved in rendering
572+
.. seealso:: setFixedAspectRatio() QgsSvgCache
539573
:rtype: float
540574
%End
541-
void setFixedAspectRatio( double far );
575+
576+
void setFixedAspectRatio( double ratio );
577+
%Docstring
578+
Set the marker aspect ratio between width and height to be used in rendering,
579+
if the value set is lower or equal to 0 the aspect ratio will be preserved in rendering
580+
\param ratio Fixed Aspect Ratio
581+
.. seealso:: fixedAspectRatio() QgsSvgCache
582+
%End
542583

543584
virtual QColor fillColor() const;
544585
virtual void setFillColor( const QColor &color );

python/core/symbology/qgssvgcache.sip

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ the parameters 'fill-color', 'pen-color', 'outline-width', 'stroke-width'. E.g.
109109
\param strokeWidth width of stroke
110110
\param widthScaleFactor width scale factor
111111
\param fitsInCache
112+
\param fixedAspectRatio fixed aspect ratio (optional)
112113
:rtype: QImage
113114
%End
114115

@@ -123,6 +124,7 @@ the parameters 'fill-color', 'pen-color', 'outline-width', 'stroke-width'. E.g.
123124
\param strokeWidth width of stroke
124125
\param widthScaleFactor width scale factor
125126
\param forceVectorOutput
127+
\param fixedAspectRatio fixed aspect ratio (optional)
126128
:rtype: QPicture
127129
%End
128130

@@ -136,6 +138,7 @@ the parameters 'fill-color', 'pen-color', 'outline-width', 'stroke-width'. E.g.
136138
\param stroke color of stroke
137139
\param strokeWidth width of stroke
138140
\param widthScaleFactor width scale factor
141+
\param fixedAspectRatio fixed aspect ratio (optional)
139142
:return: viewbox size set in SVG file
140143
.. versionadded:: 2.14
141144
:rtype: QSizeF
@@ -209,6 +212,7 @@ Emit a signal to be caught by qgisapp and display a msg on status bar
209212
\param stroke color of stroke
210213
\param strokeWidth width of stroke
211214
\param widthScaleFactor width scale factor
215+
\param fixedAspectRatio fixed aspect ratio (optional)
212216
:rtype: QgsSvgCacheEntry
213217
%End
214218

python/gui/symbology/qgssymbollayerwidget.sip

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,11 +364,6 @@ class QgsSvgMarkerSymbolLayerWidget : QgsSymbolLayerWidget
364364
public slots:
365365
void setName( const QModelIndex &idx );
366366
void populateIcons( const QModelIndex &idx );
367-
void setWidth();
368-
void setHeight();
369-
void stateChangedAspectRatio();
370-
void setAngle();
371-
void setOffset();
372367
void on_mFileToolButton_clicked();
373368
void on_mFileLineEdit_textEdited( const QString &text );
374369
void on_mFileLineEdit_editingFinished();

0 commit comments

Comments
 (0)