Commit 51745620 authored by Dennis Nienhüser's avatar Dennis Nienhüser
Browse files

Cache the viewLatLonAltBox outside the loop

parent cf455de8
......@@ -465,6 +465,7 @@ QVector<VisiblePlacemark *> PlacemarkLayout::generateLayout( const ViewportParam
}
qSort(placemarkList.begin(), placemarkList.end(), GeoDataPlacemark::placemarkLayoutOrderCompare);
auto const viewLatLonAltBox = viewport->viewLatLonAltBox();
foreach ( const GeoDataPlacemark *placemark, placemarkList ) {
const GeoDataCoordinates coordinates = placemarkIconCoordinates( placemark );
if ( !coordinates.isValid() ) {
......@@ -479,7 +480,7 @@ QVector<VisiblePlacemark *> PlacemarkLayout::generateLayout( const ViewportParam
qreal x = 0;
qreal y = 0;
if ( !viewport->viewLatLonAltBox().contains( coordinates ) ||
if ( !viewLatLonAltBox.contains( coordinates ) ||
! viewport->screenCoordinates( coordinates, x, y )) {
delete m_visiblePlacemarks.take( placemark );
continue;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment