|
|
|
|
@ -96,14 +96,12 @@ void draw_mousebtnup (int x, int y, int btn)
|
|
|
|
|
mousebtn = 0;
|
|
|
|
|
|
|
|
|
|
/* check for debugging routeing problems */
|
|
|
|
|
if (route && y > gfx_screensize.y-32 && y < gfx_screensize.y && x > 0 && x < 100 )
|
|
|
|
|
{
|
|
|
|
|
if (route && y > gfx_screensize.y-32 && y < gfx_screensize.y && x > 0 && x < 100 ) {
|
|
|
|
|
view_lon = route->closest_lon;
|
|
|
|
|
view_lat = route->closest_lat;
|
|
|
|
|
draw_del_flag (DRAW_GPSFOLLOW);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
else {
|
|
|
|
|
lat = -map_km2lat(((float)(y-gfx_screensize.y/2)) * view_scale);
|
|
|
|
|
lon = map_km2lon(((float)(x-gfx_screensize.x/2)) * view_scale, view_lat + lat);
|
|
|
|
|
|
|
|
|
|
@ -111,24 +109,20 @@ void draw_mousebtnup (int x, int y, int btn)
|
|
|
|
|
dy = abs (mousebtnpresspos.y-y)*100/gfx_screensize.y;
|
|
|
|
|
|
|
|
|
|
/* short time button pressing */
|
|
|
|
|
if (t - mousebtnpresstime <= 1)
|
|
|
|
|
{
|
|
|
|
|
if (dx < 10 && dy < 10)
|
|
|
|
|
{
|
|
|
|
|
if (select_enabled)
|
|
|
|
|
{
|
|
|
|
|
d_printf ("released mouse button..");
|
|
|
|
|
if (t - mousebtnpresstime <= 1) {
|
|
|
|
|
if (dx < 10 && dy < 10) {
|
|
|
|
|
if (select_enabled) {
|
|
|
|
|
select_enabled = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
else {
|
|
|
|
|
select_enabled = 1;
|
|
|
|
|
select_pos.lat = view_lat + lat;
|
|
|
|
|
select_pos.lon = view_lon + lon;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (mousebtnpresslongtime && dx < 10 && dy < 10)
|
|
|
|
|
{
|
|
|
|
|
else if (mousebtnpresslongtime && dx < 10 && dy < 10) {
|
|
|
|
|
/* long time button pressed */
|
|
|
|
|
wnd_mapcontext_show ();
|
|
|
|
|
}
|
|
|
|
|
@ -138,12 +132,10 @@ void draw_mousebtnup (int x, int y, int btn)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void draw_mouseloop ()
|
|
|
|
|
{
|
|
|
|
|
void draw_mouseloop () {
|
|
|
|
|
time_t t = time(NULL);
|
|
|
|
|
|
|
|
|
|
if (mousebtn && t - mousebtnpresstime > 1)
|
|
|
|
|
{
|
|
|
|
|
if (mousebtn && t - mousebtnpresstime > 1) {
|
|
|
|
|
mousebtnpresslongtime = 1;
|
|
|
|
|
d_printf ("draw_mouseloop: long press..");
|
|
|
|
|
draw ();
|
|
|
|
|
|