[Marble-bugs] [Bug 299959] New: GeoDataLatLonBox default ctor is little intuitive | united() is buggy

Dennis Nienhüser earthwings at gentoo.org
Sun May 13 20:47:05 UTC 2012


https://bugs.kde.org/show_bug.cgi?id=299959

            Bug ID: 299959
          Severity: normal
           Version: unspecified
          Priority: NOR
          Assignee: marble-bugs at kde.org
           Summary: GeoDataLatLonBox default ctor is little intuitive |
                    united() is buggy
    Classification: Unclassified
                OS: Linux
          Reporter: earthwings at gentoo.org
          Hardware: Other
            Status: NEW
         Component: general
           Product: marble

The ctor without arguments creates a latlonbox that covers the full globe.
Being used to QRect and similar I find this little intuitive and would expect
an empty sized box instead.

Here are two examples why this is not intuitive:

1)
GeoDataLatLonBox one;
one.isEmpty(); // true
one.isNull(); // false

GeoDataLatLonBox two(0,0,0,0);
two.isEmpty(); // false
two.isNull(); // true

In my opinion isNull()==true should imply isEmpty()==true which is not the case
for box two.

2)
GeoDataLatLonBox box;
GeoDataLatLonBox otherBox(1,2,3,4);
box = box.united(otherBox);

In 2) I'd like to have box == otherBox, which would work if the default ctor
was constructing a null box.

On a related note, the latter case (uniting with a default constructed box)
leads to a possible bug in the bound calculation. For example, uniting (showing
west and east bounds in degrees now for each)
[-180 180] with [8.41941 8.42429] results in [180 8.42429]


Reproducible: Always

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Marble-bugs mailing list