Feature request #2648

Improve rendering of selected features with V2 symbology

Added by Chris Crook over 14 years ago. Updated over 14 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:Symbology
Pull Request or Patch supplied: Resolution:fixed
Easy fix?:No Copied to github as #:12708

Description

The current implementation of rendering of selected features with V2 rendering doesn't reflect the normal unselected symbology - it simply replaces points, lines, and polygons with a default renderer using the selected colour.

This patch suggests an alternative, in which the selected state is passed from the renderer into the symbol and symbol layers, and in which each symbol layer build its own implementation of selected rendering.
This has been implemented for each of the core symbol layer types as follows:
*Simple marker symbols: simple symbols are selected by setting the fill or border colour (for unfilled symbols or where the current fill colour is the same as the selected colour). If this doesn't differentiate the normal and selected version, then the selected version is completely filled with the selection colour.
*SVN markers symbols: A circle in the selection colour is drawn under each SVN symbol
*Font marker symbols: The font colour is changed to the selection colour
*Line symbols - colours are changed to the selection colour
*Polygon layers - colours are changed to the selection colour
Also the transparency is disregarded for selected symbols - they are fully opaque

selection_rendering_fix.diff Magnifier - Patch to implement suggested change to rendering (20.6 KB) Chris Crook, 2010-04-13 05:49 PM

selection_rendering_fix_sip.diff Magnifier - Second part of patch - fixes SIP file to make required fields available to plugins (703 Bytes) Chris Crook, 2010-04-14 01:17 PM

selection_rendering_fix_revised.diff Magnifier - Replacement for above two patches - more logical implementation (21.4 KB) Chris Crook, 2010-04-15 12:03 PM

History

#1 Updated by Giovanni Manghi over 14 years ago

Great! much awaited features. After applying this patch at least 2/3 tickets can be closed.

#2 Updated by Chris Crook over 14 years ago

I'm going to change the implementation slightly - I've put a method (selectionColor()) into the base QgsSymbologyLayerV2 class, but it belongs in the symbology render context. I'll put up a new patch shortly.

#3 Updated by Chris Crook over 14 years ago

Note: the selection_rendering_fix_revised patch includes the patches from both of the previous files. It also includes a fix to QgsFontMarkerSymbolLayerV2 to correct the scaling when it is printed or rendered to png/pdf etc via composer. Previously the raster scale factor wasn't being applied, which could result in the Font marker appearing hugely out of scale!

#4 Updated by Martin Dobias over 14 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

Looks good, applied in 8c7a31d3 (SVN r13323). Thanks for contributing!

Martin

#5 Updated by Giovanni Manghi over 14 years ago

Please have a look to tickets #1786 and #1509

if you think that after this commit they can be closed, do so.

Also available in: Atom PDF