Bug 381511 - GeoDataLineString::setTessellate function fails to unset tessellation.
Summary: GeoDataLineString::setTessellate function fails to unset tessellation.
Status: RESOLVED FIXED
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: marble-bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-22 02:52 UTC by Dean Adamson
Modified: 2017-06-26 19:06 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Adamson 2017-06-22 02:52:08 UTC
When you pass in false into the function GeoDataLineString::setTessellate in GeoDataLineString.cpp lines 478-493, it can actually set tessellation on instead of off. This happens because the function is using a xor operator when it should be using an and operator. See below:

    if ( tessellate ) {
        p()->m_tessellationFlags |= Tessellate;
        p()->m_tessellationFlags |= RespectLatitudeCircle;
    } else {
        p()->m_tessellationFlags ^= Tessellate;
        p()->m_tessellationFlags ^= RespectLatitudeCircle;
    }

The above should really be the following:

    if ( tessellate ) {
        p()->m_tessellationFlags |= (Tessellate | RespectLatitudeCircle);
    } else {
        p()->m_tessellationFlags &= ~(Tessellate | RespectLatitudeCircle);
    }
Comment 1 Dean Adamson 2017-06-22 02:54:47 UTC
Happy to fix this my self if someone would pass me the instructions on how to submit my changes.
Comment 2 Dennis Nienhüser 2017-06-22 04:11:22 UTC
Good catch. For applying the changes it would be great if you could create a review request in http://phabricator.kde.org (Differential) from the patch.
Comment 3 Dean Adamson 2017-06-23 04:42:08 UTC
I tried to add a view request but I need a login for that and I can not find any place for me to create my own login at http://phabricator.kde.org.
Comment 4 Dennis Nienhüser 2017-06-23 17:50:19 UTC
The registration is at https://identity.kde.org
Comment 5 Dennis Nienhüser 2017-06-26 19:06:55 UTC
Git commit 7b2207d2ab0725b078fd1ce055a822ba70bc23b9 by Dennis Nienhüser, on behalf of Dean Adamson.
Committed on 26/06/2017 at 19:06.
Pushed by nienhueser into branch 'master'.

Fix function using xor operator when it should be using an and operator

M  +3    -5    src/lib/marble/geodata/data/GeoDataLineString.cpp

https://commits.kde.org/marble/7b2207d2ab0725b078fd1ce055a822ba70bc23b9