Skip to content
Permalink
Browse files

Fix rule based label/symbol renderers reset max scale for rules to

1:100000

And improve dox

Fixes #21845
  • Loading branch information
nyalldawson committed May 21, 2019
1 parent 2e114ad commit 37946131bf26f6fb46ab70f364a2e4e03ed1c12f
@@ -68,6 +68,13 @@ The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
.. seealso:: :py:func:`setMaximumScale`

.. seealso:: :py:func:`setScaleRange`

.. warning::

Calling setMinimumScale() places a restriction on the acceptable maximum scale for the
widget, and will alter any previously set maximum scale to pass this constraint. Always
call setMinimumScale() before setMaximumScale() when restoring a scale range in the widget, or
use the convenience method setScaleRange() instead.
%End

void setMaximumScale( double scale );
@@ -80,6 +87,13 @@ The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
.. seealso:: :py:func:`setMinimumScale`

.. seealso:: :py:func:`setScaleRange`

.. warning::

Calling setMinimumScale() places a restriction on the acceptable maximum scale for the
widget, and will alter any previously set maximum scale to pass this constraint. Always
call setMinimumScale() before setMaximumScale() when restoring a scale range in the widget, or
use the convenience method setScaleRange() instead.
%End

void setScaleRange( double min, double max );
@@ -596,8 +596,8 @@ QgsLabelingRulePropsWidget::QgsLabelingRulePropsWidget( QgsRuleBasedLabeling::Ru
{
groupScale->setChecked( true );
// caution: rule uses scale denom, scale widget uses true scales
mScaleRangeWidget->setMaximumScale( std::max( rule->maximumScale(), 0.0 ) );
mScaleRangeWidget->setMinimumScale( std::max( rule->minimumScale(), 0.0 ) );
mScaleRangeWidget->setScaleRange( std::max( rule->minimumScale(), 0.0 ),
std::max( rule->maximumScale(), 0.0 ) );
}
mScaleRangeWidget->setMapCanvas( mMapCanvas );

@@ -77,6 +77,11 @@ class GUI_EXPORT QgsScaleRangeWidget : public QWidget
* \see minimumScale()
* \see setMaximumScale()
* \see setScaleRange()
*
* \warning Calling setMinimumScale() places a restriction on the acceptable maximum scale for the
* widget, and will alter any previously set maximum scale to pass this constraint. Always
* call setMinimumScale() before setMaximumScale() when restoring a scale range in the widget, or
* use the convenience method setScaleRange() instead.
*/
void setMinimumScale( double scale );

@@ -86,6 +91,11 @@ class GUI_EXPORT QgsScaleRangeWidget : public QWidget
* \see maximumScale()
* \see setMinimumScale()
* \see setScaleRange()
*
* \warning Calling setMinimumScale() places a restriction on the acceptable maximum scale for the
* widget, and will alter any previously set maximum scale to pass this constraint. Always
* call setMinimumScale() before setMaximumScale() when restoring a scale range in the widget, or
* use the convenience method setScaleRange() instead.
*/
void setMaximumScale( double scale );

@@ -647,8 +647,8 @@ QgsRendererRulePropsWidget::QgsRendererRulePropsWidget( QgsRuleBasedRenderer::Ru
if ( mRule->dependsOnScale() )
{
groupScale->setChecked( true );
mScaleRangeWidget->setMaximumScale( std::max( rule->maximumScale(), 0.0 ) );
mScaleRangeWidget->setMinimumScale( std::max( rule->minimumScale(), 0.0 ) );
mScaleRangeWidget->setScaleRange( std::max( rule->minimumScale(), 0.0 ),
std::max( rule->maximumScale(), 0.0 ) );
}
mScaleRangeWidget->setMapCanvas( mContext.mapCanvas() );

0 comments on commit 3794613

Please sign in to comment.
You can’t perform that action at this time.