bool public_transit_enabled;
bool scalebar_enabled;
+ /* To check hit_test */
+ int screen_dpi;
+ int min_hit_area;
+
void *maps_plugin_view_handle;
} maps_view_s;
v->traffic_enabled = false;
v->public_transit_enabled = false;
+ /* To check hit_test */
+ v->screen_dpi = maps_get_display_dpi();
+ v->min_hit_area = MAX(20, v->screen_dpi / 5);
+
return MAPS_ERROR_NONE;
}
y -= h / 2;
/* Add some margin of the hit-area. */
- if (w < 30) w = 30;
- if (h < 30) h = 30;
+ w = MAX(w, htd->v->min_hit_area);
+ h = MAX(h, htd->v->min_hit_area);
+
+ /* Gets a half range to check hit-area */
+ int hw = (int)(w / 2. + .5);
+ int hh = (int)(h / 2. + .5);
/* Check hit-area */
- if ((x > (htd->x - w)) && (x < (htd->x + w))
- && (y > (htd->y - h)) && (y < (htd->y + h))) {
+ if ((x > (htd->x - hw)) && (x < (htd->x + hw))
+ && (y > (htd->y - hh)) && (y < (htd->y + hh))) {
htd->object = object;
}
break;
#include "maps_util.h"
#include "maps_error.h"
#include <glib.h>
+#include <system_info.h>
+
+#define DEFAULT_UNKNOWN_DPI 132
int maps_set_string(const char *src, const int max_length, char **dst)
{
*dst = g_strndup(src, max_length);
return MAPS_ERROR_NONE;
}
+
+int maps_get_display_dpi()
+{
+ int dpi = DEFAULT_UNKNOWN_DPI;
+ system_info_get_platform_int("http://tizen.org/feature/screen.dpi", &dpi);
+ return dpi;
+}
*/
int maps_get_string(const char *src, const int max_length, char **dst);
+int maps_get_display_dpi();
+
/* Prevent utility highlights defects in std::vector and std::string, so
* simplified versions of that classes are implemented */
template <class T> class vector {