[QGIS-Developer] void QgsMapSettings::setExtent( const QgsRectangle &rect, bool magnified = true );

Alessandro Pasotti apasotti at gmail.com
Tue Sep 22 07:16:05 PDT 2020


Hi,

Does this make sense to anyone?

We have the documentation for
void QgsMapCanvas::setExtent( const QgsRectangle &r, bool magnified =
false ); that clearly states The \a magnified argument dictates
whether existing canvas constraints such
     * as a scale lock should be respected or not during the
operation. If \a magnified is
     * TRUE then an existing scale lock constraint will be applied.

But then we call the homonymous (and underdocumented) method in
QgsMapSettings https://github.com/qgis/QGIS/blob/master/src/gui/qgsmapcanvas.cpp#L1089
and... here is were we break our promise
https://github.com/qgis/QGIS/blob/master/src/core/qgsmapsettings.cpp#L83

We do nothing about locked scale (which is ok because the scale lock
belongs to the canvas) and we change the semantics of "magnified" and
apply the magnification factor when that one is FALSE (!).

I really don't understand the logic behind it, can someone please shed
some light on this?

I'm going to fix the issue (about scale locked) in the canvas method
but I still think that we should clear this API unless I totally
misunderstood it.

Thanks

-- 
Alessandro Pasotti
QCooperative:  www.qcooperative.net
ItOpen:   www.itopen.it


More information about the QGIS-Developer mailing list