[Marble-devel] Review Request 124989: Edit Maps: Placemark label color highlight on focus (quick fix).
Constantin Mihalache
mihalache.c94 at gmail.com
Sun Aug 30 12:38:57 UTC 2015
> On Aug. 30, 2015, 5:08 a.m., Dennis Nienhüser wrote:
> > What performance impact does this have? It might affect rendering speed.
> > I would rather extend drawLabelPixmap to take another argument isSelected and then cache two pixmaps, one for the selected case and one for the not selected. Then return the right one based on the value of m_selected.
(Indeed, this would affect rendering performance and what you suggested sounds right, but I don't see how it could work. The problem is that m_selected is not set properly because **VisiblePlacemark::setSelected(bool)** is never called. If **m_selected** stores whether a placemark has focus or not, I don't think it can ever be set right due to the fact that placemark selecting is handled in the AnnotatePlugin (which deals with SceneGrapicItems). It may be something that I don't understand right...
What is not working in the first place is that a **PlacemarkTextAnnotation**'s (which is a SceneGraphicItem) *paint()* method (which sets the GeoDataPlacemark's label color based on the focus) is called after all the VisiblePlacemarks are constructed (drawLabelPixmap() is called here) and then "collected" to be drawn on the map inside the PlacemarkLayer.
***problem++: *** I think that changing a GeoDataPlacemark's label style property to highlight it on the map is risky. If an export to .kml (or any other format supported) is called, the selected placemark would be saved with the highlighted color and not its original one.
PS: if m_selected can be properly set, this issue can be easily fixed by handling the label highlight solely in the VisiblePlacemark class.
- Constantin
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/124989/#review84568
-----------------------------------------------------------
On Aug. 30, 2015, 12:02 a.m., Constantin Mihalache wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/124989/
> -----------------------------------------------------------
>
> (Updated Aug. 30, 2015, 12:02 a.m.)
>
>
> Review request for Marble.
>
>
> Repository: marble
>
>
> Description
> -------
>
> ** bug: **When a placemark is selected (left mouse click) and then deselected, it's label color does not change accordingly (it stays highlighted). When deselecting, the color changes to the original one only if the placemark is dragged out of the screen and then brought back.
>
> * the main issue is that each VisiblePlacemark's labelPixmap should be generated exactly before painting.
> * this may not be an elegant fix, but it works
>
>
> Diffs
> -----
>
> src/lib/marble/VisiblePlacemark.h 805112d
> src/lib/marble/VisiblePlacemark.cpp 2fdc8ec
>
> Diff: https://git.reviewboard.kde.org/r/124989/diff/
>
>
> Testing
> -------
>
> Created placemarks -> clicked on the icon of the placemark -> label is highlighted -> clicked on the globe -> label is not highlighted.
>
>
> Thanks,
>
> Constantin Mihalache
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20150830/dd7f4190/attachment.html>
More information about the Marble-devel
mailing list