Opened 16 years ago

Closed 15 years ago

Last modified 15 years ago

#1016 closed patch (fixed)

mysterious white box obscures data in the map window

Reported by: rgaston Owned by: mhugent
Priority: major: does not work as expected Milestone:
Component: Graphics Version: Trunk
Keywords: obscuring box, digitizing, zooming Cc: blake@…, msieczka
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

Description

We are currently working on a project for which we have data being digitized by a team in Jordan using QGIS. We have encountered an issue that is slowing work where members of our team have been unable to see data in the map window while digitizing new polygon features because a mysterious white box appears after the third vertex is added that obscures data in the map window. They are using version 0.9.0 and I have been thus far unable to find any information or discussion about such an error. I was curious if this error was something you were aware of at all in that version. One of my colleagues suggested that it may be a graphic driver issue, but I have been unable to locate system requirements for QGIS anywhere in the documentation. Is there anywhere that I can locate this information?

Attachments (4)

digitizing_obscured_mask_problem.png (20.4 KB ) - added by springmeyer 16 years ago.
Image of rendering problem with disappearing vectors during editing
zoom_box_obscuring_problem.png (14.2 KB ) - added by springmeyer 16 years ago.
Similar problem occurring during use of bbox zoom tool where the space behind tool coordinates covers vectors
patch_for_1016.txt (850 bytes ) - added by smizuno 16 years ago.
fix white box
patch2_for_1016.txt (1.2 KB ) - added by smizuno 15 years ago.
fix root cause of white box problem

Download all attachments as: .zip

Change History (15)

comment:1 by jef, 16 years ago

see also #1093

comment:2 by springmeyer, 16 years ago

Cc: blake@… added
Keywords: obscuring box digitizing zooming added
Platform: WindowsAll

I have been running into this problem as well, using 0.10.0 on mac osx. It does not seem occur all the time, and I have not been able to track down a way to predictably trigger it when not happening. However, when it does happen(estimated 60% of qgis use for me) it makes accurate digitization extremely difficult and troublesome.

It seems closely related to the similar issue of having the bounding box tool draw a solid grey polygon rather than a transparent polygon bbox. Additionally when the bbox is dragged over any vector features and then moved it leaves pure white. This also seems to occur will all other tools that have some drag or draw component.

Two screenshots are attached of the digitizing tool and bbox zoom tool causing rendering problem.

Changing the rendering properties in preferences does not seem to effect the problem.

by springmeyer, 16 years ago

Image of rendering problem with disappearing vectors during editing

by springmeyer, 16 years ago

Similar problem occurring during use of bbox zoom tool where the space behind tool coordinates covers vectors

comment:3 by smizuno, 16 years ago

more information (based on Windows builds):

(a work-around) I have discovered that using the Pan Map tool, then dragging the mouse to pan even just a little bit makes the problem go away for as long as the QGIS session is used. It is critical that the map be panned by the mouse gesture; just clicking on the map or using any other tool or even keyboard panning does not affect the problem.

In addition, if a tool bar is moved around and the map canvas is resized so the toolbar can be docked also makes the problem go away.

The white box is actually the background color.

Most any tool that involves a mouse drag gesture will cause the obscuring box in at least some situations.

Using the zoom in/zoom out tools may result in a box that is partially obscuring the map, depending on how fast the mouse is dragged.

A tool bar that drops over the map canvas also leaves a blank area behind.

Once the map is panned by the mouse there is still a box that flashes momentarily while zooming or panning. It changes size with zooming and moves with panning, so I believe there is an object hanging around on some layer.

The problem first appeared with version 0.9.0, I believe.

I have not noticed this problem on my Linux installation, but also have not tested very much.

by smizuno, 16 years ago

Attachment: patch_for_1016.txt added

fix white box

comment:4 by smizuno, 16 years ago

Type: defectpatch

I have found that white boxes are caused by the order of setting a new size for mMap and mScene in the QgsMapCanvas::resizeEvent(QResizeEvent * e) function. I believe that mScene should be set after mMap. The order doesn't seem to be a factor except at program startup.

While I was poking around in QgsMapCanvas.cpp I took the liberty of adding zoom in, zoom out abilities by the PageUp, PageDown keys respectively. This is something that I had considered for an enhancement as it is useful to have zooming if you can pan via the keyboard. Also, not all pointing devices have a wheel. They use the zoom function that the mouse wheel zoom uses, hence the same zoom factor.

The patch I have provided fixes the most annoying part of the white box problem and adds the keyboard zoom. There still are white boxes that flash momentarily when the map is redrawn after certain tools have been used.

Have tested on Windows and Linux, but not Mac.

comment:5 by mhugent, 16 years ago

Owner: changed from nobody to mhugent

Hi Smizuno

I'm going to review this patch.

Thanks, Marco

comment:6 by mhugent, 16 years ago

Resolution: fixed
Status: newclosed

Applied in r9142. Thanks!

Marco

comment:7 by msieczka, 16 years ago

Cc: msieczka added

comment:8 by smizuno, 15 years ago

Resolution: fixed
Status: closedreopened

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().

by smizuno, 15 years ago

Attachment: patch2_for_1016.txt added

fix root cause of white box problem

comment:9 by mhugent, 15 years ago

Applied to trunk and to 1.0 branch. Thanks!

Marco

comment:10 by mhugent, 15 years ago

Resolution: fixed
Status: reopenedclosed

comment:11 by (none), 15 years ago

Milestone: Version 1.0.0

Milestone Version 1.0.0 deleted

Note: See TracTickets for help on using tickets.