Commit fd54b7cc authored by Jiří Techet's avatar Jiří Techet

Swap elements in the BoundingBox structure and fix center computation

parent 31182412
......@@ -106,8 +106,8 @@ champlain_bounding_box_free (ChamplainBoundingBox *bbox)
/**
* champlain_bounding_box_get_center:
* @bbox: a #ChamplainBoundingBox
* @lat: (out): the latitude of the box center
* @lon: (out): the longitude of the box center
* @latitude: (out): the latitude of the box center
* @longitude: (out): the longitude of the box center
*
* Sets the latitude and longitude of the box to @lat and @lon.
*
......@@ -115,11 +115,11 @@ champlain_bounding_box_free (ChamplainBoundingBox *bbox)
*/
void
champlain_bounding_box_get_center (ChamplainBoundingBox *bbox,
gdouble *lat,
gdouble *lon)
gdouble *latitude,
gdouble *longitude)
{
g_return_if_fail (CHAMPLAIN_BOUNDING_BOX (bbox));
*lat = (bbox->right + bbox->left) / 2.0;
*lon = (bbox->top + bbox->bottom) / 2.0;
*longitude = (bbox->right + bbox->left) / 2.0;
*latitude = (bbox->top + bbox->bottom) / 2.0;
}
......@@ -34,9 +34,9 @@ typedef struct _ChamplainBoundingBox ChamplainBoundingBox;
/**
* ChamplainBoundingBox:
* @left: left coordinate
* @bottom: bottom coordinate
* @right: right coordinate
* @top: top coordinate
* @right: right coordinate
* @bottom: bottom coordinate
*
* Defines the area of a ChamplainMapDataSource that contains data.
*
......@@ -45,9 +45,9 @@ typedef struct _ChamplainBoundingBox ChamplainBoundingBox;
struct _ChamplainBoundingBox
{
gdouble left;
gdouble bottom;
gdouble right;
gdouble top;
gdouble right;
gdouble bottom;
};
GType champlain_bounding_box_get_type (void) G_GNUC_CONST;
......@@ -60,8 +60,8 @@ ChamplainBoundingBox *champlain_bounding_box_copy (const ChamplainBoundingBox *b
void champlain_bounding_box_free (ChamplainBoundingBox *bbox);
void champlain_bounding_box_get_center (ChamplainBoundingBox *bbox,
gdouble *lat,
gdouble *lon);
gdouble *latitude,
gdouble *longitude);
G_END_DECLS
......
......@@ -466,8 +466,8 @@ set_data (ChamplainRenderer *renderer,
bbox = champlain_bounding_box_new ();
memphis_map_get_bounding_box (map, &bbox->left, &bbox->top,
&bbox->right, &bbox->bottom);
memphis_map_get_bounding_box (map, &bbox->bottom, &bbox->left, &bbox->top,
&bbox->right);
g_object_set (G_OBJECT (renderer), "bounding-box", bbox, NULL);
champlain_bounding_box_free (bbox);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment