Add shadows to the markers
Submitted by Emmanuel Rodriguez
Link to original bug (#577809)
Description
It would be nice if the markers could have a shadow. Although, this shouldn't be mandatory to all markers.
It's possible to implement a trivial shadow by re-rendering the marker a second time but by using the cairo fill method with an alpha channel and by applying a transformation matrix with a shear.
I tried to implement a basic version of the shadows and this idea gives some decent results. At better way for the shadows would be to use some blur or radial coloring, but this are just esthetic changes.
I see two ways for implementing the shadows:
- as a drawing operation within the marker
- as a separate actor that's grouped with the marker and placed in the background.
The first approach has as an advantage that the drawing code can be shared between the rendering of the marker and of the shadow. It has a major disadvantage as the shadows get clipped at the top of the marker. This is because the marker starts drawing on top of the texture. For the shadows to work well the marker's texture will need to be bigger and the drawing of the marker will need to be done at the bottom.
The second approach should allow a better control of the shadow since it consists of a different clutter actor. It could allow nice effects with animations, e.g.: if a push-pin marker falls from the sky the shadow could get closer and closer as the marker drops to the ground. The disadvantage would be that the drawing of the marker would not be easily shared. Maybe we could add an interface "marker-shadow" that markers could implement. This would allow the rendering code to be shared as a marker drawing a shadow would simply implement the method an provide a simpler "flat shadded" rendering with no extra details and a dedicated actor will use this texture for drawing the shadow.