Skip to content

Commit

Permalink
Use screen's physical DPI value again, android regression fixed in Qt…
Browse files Browse the repository at this point in the history
… 6.5.3
  • Loading branch information
nirvn committed Oct 11, 2023
1 parent b80e868 commit ac6dc33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/core/qgsquick/qgsquickelevationprofilecanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class QgsElevationProfilePlotItem : public Qgs2DPlot

// force immediate recalculation of plot area
QgsRenderContext context;
context.setScaleFactor( ( mCanvas->window()->screen()->logicalDotsPerInch() * mCanvas->window()->screen()->devicePixelRatio() ) / 25.4 );
context.setScaleFactor( ( mCanvas->window()->screen()->physicalDotsPerInch() * mCanvas->window()->screen()->devicePixelRatio() ) / 25.4 );

calculateOptimisedIntervals( context );
mPlotArea = interiorPlotArea( context );
Expand Down Expand Up @@ -290,7 +290,7 @@ void QgsQuickElevationProfileCanvas::refresh()
connect( mCurrentJob, &QgsProfilePlotRenderer::generationFinished, this, &QgsQuickElevationProfileCanvas::generationFinished );

QgsProfileGenerationContext generationContext;
generationContext.setDpi( window()->screen()->logicalDotsPerInch() * window()->screen()->devicePixelRatio() );
generationContext.setDpi( window()->screen()->physicalDotsPerInch() * window()->screen()->devicePixelRatio() );
generationContext.setMaximumErrorMapUnits( MAX_ERROR_PIXELS * ( mProfileCurve.get()->length() ) / mPlotItem->plotArea().width() );
generationContext.setMapUnitsPerDistancePixel( mProfileCurve.get()->length() / mPlotItem->plotArea().width() );
mCurrentJob->setContext( generationContext );
Expand Down Expand Up @@ -449,7 +449,7 @@ void QgsQuickElevationProfileCanvas::refineResults()
if ( mCurrentJob )
{
QgsProfileGenerationContext context;
context.setDpi( window()->screen()->logicalDotsPerInch() * window()->screen()->devicePixelRatio() );
context.setDpi( window()->screen()->physicalDotsPerInch() * window()->screen()->devicePixelRatio() );
const double plotDistanceRange = mPlotItem->xMaximum() - mPlotItem->xMinimum();
const double plotElevationRange = mPlotItem->yMaximum() - mPlotItem->yMinimum();
const double plotDistanceUnitsPerPixel = plotDistanceRange / mPlotItem->plotArea().width();
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsquick/qgsquickmapcanvasmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ void QgsQuickMapCanvasMap::onScreenChanged( QScreen *screen )
{
mMapSettings->setDevicePixelRatio( screen->devicePixelRatio() );
}
mMapSettings->setOutputDpi( screen->logicalDotsPerInch() );
mMapSettings->setOutputDpi( screen->physicalDotsPerInch() );
}
}

Expand Down

1 comment on commit ac6dc33

@qfield-fairy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.