Skip to content

Commit 1a6df7d

Browse files
author
jef
committed
speed up QgsRubberBand::setToGeometry()
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9916 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 65e064a commit 1a6df7d

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/gui/qgsrubberband.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@ void QgsRubberBand::setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
186186
{
187187
pt = geom->asPoint();
188188
}
189-
addPoint( QgsPoint( pt.x() - d, pt.y() - d ) );
190-
addPoint( QgsPoint( pt.x() + d, pt.y() - d ) );
191-
addPoint( QgsPoint( pt.x() + d, pt.y() + d ) );
192-
addPoint( QgsPoint( pt.x() - d, pt.y() + d ) );
189+
addPoint( QgsPoint( pt.x() - d, pt.y() - d ), false );
190+
addPoint( QgsPoint( pt.x() + d, pt.y() - d ), false );
191+
addPoint( QgsPoint( pt.x() + d, pt.y() + d ), false );
192+
addPoint( QgsPoint( pt.x() - d, pt.y() + d ), false );
193193
}
194194
break;
195195

@@ -204,17 +204,17 @@ void QgsRubberBand::setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
204204
QgsPoint pt = mpt[i];
205205
if ( layer )
206206
{
207-
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() - d, pt.y() - d ) ) );
208-
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() + d, pt.y() - d ) ) );
209-
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() + d, pt.y() + d ) ) );
210-
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() - d, pt.y() + d ) ) );
207+
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() - d, pt.y() - d ) ), false );
208+
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() + d, pt.y() - d ) ), false );
209+
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() + d, pt.y() + d ) ), false );
210+
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() - d, pt.y() + d ) ), false );
211211
}
212212
else
213213
{
214-
addPoint( QgsPoint( pt.x() - d, pt.y() - d ) );
215-
addPoint( QgsPoint( pt.x() + d, pt.y() - d ) );
216-
addPoint( QgsPoint( pt.x() + d, pt.y() + d ) );
217-
addPoint( QgsPoint( pt.x() - d, pt.y() + d ) );
214+
addPoint( QgsPoint( pt.x() - d, pt.y() - d ), false );
215+
addPoint( QgsPoint( pt.x() + d, pt.y() - d ), false );
216+
addPoint( QgsPoint( pt.x() + d, pt.y() + d ), false );
217+
addPoint( QgsPoint( pt.x() - d, pt.y() + d ), false );
218218
}
219219
}
220220
}
@@ -229,11 +229,11 @@ void QgsRubberBand::setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
229229
{
230230
if ( layer )
231231
{
232-
addPoint( mr->layerToMapCoordinates( layer, line[i] ) );
232+
addPoint( mr->layerToMapCoordinates( layer, line[i] ), false );
233233
}
234234
else
235235
{
236-
addPoint( line[i] );
236+
addPoint( line[i], false );
237237
}
238238
}
239239
}
@@ -259,7 +259,7 @@ void QgsRubberBand::setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
259259
}
260260
else
261261
{
262-
addPoint( line[j] );
262+
addPoint( line[j], false, i );
263263
}
264264
}
265265
}
@@ -276,11 +276,11 @@ void QgsRubberBand::setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
276276
{
277277
if ( layer )
278278
{
279-
addPoint( mr->layerToMapCoordinates( layer, line[i] ) );
279+
addPoint( mr->layerToMapCoordinates( layer, line[i] ), false );
280280
}
281281
else
282282
{
283-
addPoint( line[i] );
283+
addPoint( line[i], false );
284284
}
285285
}
286286
}
@@ -307,7 +307,7 @@ void QgsRubberBand::setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
307307
}
308308
else
309309
{
310-
addPoint( line[j] );
310+
addPoint( line[j], false, i );
311311
}
312312
}
313313
}

0 commit comments

Comments
 (0)