mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
add test for device pixel ratio in map settings
This commit is contained in:
parent
c868e62ef5
commit
3ff8477c52
@ -37,6 +37,7 @@ class TestQgsMapSettings: public QObject
|
||||
void testDefaults();
|
||||
void visibleExtent();
|
||||
void mapUnitsPerPixel();
|
||||
void testDevicePixelRatio();
|
||||
void visiblePolygon();
|
||||
void testIsLayerVisible();
|
||||
void testMapLayerListUtils();
|
||||
@ -137,6 +138,19 @@ void TestQgsMapSettings::mapUnitsPerPixel()
|
||||
QCOMPARE( ms.mapUnitsPerPixel(), 0.2 );
|
||||
}
|
||||
|
||||
void TestQgsMapSettings::testDevicePixelRatio()
|
||||
{
|
||||
QgsMapSettings ms;
|
||||
ms.setOutputSize( QSize( 100, 50 ) );
|
||||
ms.setExtent( QgsRectangle( 0, 0, 100, 100 ) );
|
||||
ms.setDevicePixelRatio( 1 );
|
||||
double scale = ms.scale();
|
||||
ms.setDevicePixelRatio( 1.5 );
|
||||
ms.setExtent( QgsRectangle( 0, 0, 100, 100 ) );
|
||||
QCOMPARE( ms.outputSize() * 1.5, ms.deviceOutputSize() );
|
||||
QCOMPARE( scale * 1.5, ms.scale() );
|
||||
}
|
||||
|
||||
void TestQgsMapSettings::visiblePolygon()
|
||||
{
|
||||
QgsMapSettings ms;
|
||||
|
Loading…
x
Reference in New Issue
Block a user