[QGIS-trac] Re: [Quantum GIS] #1016: mysterious white box obscures
data in the map window
Quantum GIS
qgis at qgis.org
Sat Jan 10 20:53:50 EST 2009
#1016: mysterious white box obscures data in the map window
-----------------------------------------------------+----------------------
Reporter: rgaston | Owner: mhugent
Type: patch | Status: reopened
Priority: major: does not work as expected | Milestone: Version 1.0.0
Component: Graphics | Version: HEAD
Resolution: | Keywords: obscuring box, digitizing, zooming
Platform_version: | Platform: All
Must_fix: No | Status_info: 0
-----------------------------------------------------+----------------------
Changes (by smizuno):
* status: closed => reopened
* resolution: fixed =>
Comment:
I reopen this ticket as I now have a good explanation of why the problem
occurs and a further patch to fix it.
After reviewing (again... and again) the QGraphicsScene and QGraphicsItem
classes, I found that prepareGeometryChange() needs to be called before
changing a QGraphicsItem's geometry.
This is the root cause of the white boxes (artifacts of rubberbands and
other objects) on the map canvas. The mapcanvasmap had its size changed,
but the mapcanvas didn't know about it, therefore not redrawing its
objects at the new size.
I have tested this by reverting to the previous order in QgsMapCanvas
where the scene size was set, then the map size was set. Then
prepareGeometryChange() is called in QgsMapCanvasMap::resize(). Now, there
are no artifacts.
Still, it is better that the scene size is set after the map size is
changed, as the scene size change updates indexes as necessary.
The patch provided adds the prepareGeometryChange() call in
QgsMapCanvasMap::resize() and updates the note about the problem in
QgsMapCanvas::resizeEvent().
--
Ticket URL: <https://trac.osgeo.org/qgis/ticket/1016#comment:8>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats
More information about the QGIS-trac
mailing list