Add:Core:Exported zoom in/out around cursor functions
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Thu, 11 Nov 2010 18:06:57 +0000 (18:06 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Thu, 11 Nov 2010 18:06:57 +0000 (18:06 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@3674 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/navit.c
navit/navit/navit.h

index 70cb171..b9faef9 100644 (file)
@@ -646,20 +646,19 @@ navit_zoom_out(struct navit *this_, int factor, struct point *p)
        navit_scale(this_, scale, p, 1);
 }
 
        navit_scale(this_, scale, p, 1);
 }
 
-static int
-navit_cmd_zoom_in(struct navit *this_)
+void
+navit_zoom_in_cursor(struct navit *this_, int factor)
 {
        struct point p;
        if (this_->vehicle && this_->vehicle->follow_curr == 1 && navit_get_cursor_pnt(this_, &p, 0, NULL)) {
 {
        struct point p;
        if (this_->vehicle && this_->vehicle->follow_curr == 1 && navit_get_cursor_pnt(this_, &p, 0, NULL)) {
-               navit_zoom_in(this_, 2, &p);
+               navit_zoom_in(this_, factor, &p);
                this_->vehicle->follow_curr=this_->vehicle->follow;
        } else
                this_->vehicle->follow_curr=this_->vehicle->follow;
        } else
-               navit_zoom_in(this_, 2, NULL);
-       return 0;
+               navit_zoom_in(this_, factor, NULL);
 }
 
 }
 
-static int
-navit_cmd_zoom_out(struct navit *this_)
+void
+navit_zoom_out_cursor(struct navit *this_, int factor)
 {
        struct point p;
        if (this_->vehicle && this_->vehicle->follow_curr == 1 && navit_get_cursor_pnt(this_, &p, 0, NULL)) {
 {
        struct point p;
        if (this_->vehicle && this_->vehicle->follow_curr == 1 && navit_get_cursor_pnt(this_, &p, 0, NULL)) {
@@ -667,6 +666,20 @@ navit_cmd_zoom_out(struct navit *this_)
                this_->vehicle->follow_curr=this_->vehicle->follow;
        } else
                navit_zoom_out(this_, 2, NULL);
                this_->vehicle->follow_curr=this_->vehicle->follow;
        } else
                navit_zoom_out(this_, 2, NULL);
+}
+
+
+static int
+navit_cmd_zoom_in(struct navit *this_)
+{
+       navit_zoom_in_cursor(this_, 2);
+       return 0;
+}
+
+static int
+navit_cmd_zoom_out(struct navit *this_)
+{
+       navit_zoom_out_cursor(this_, 2);
        return 0;
 }
 
        return 0;
 }
 
index 92e3c71..c21c1a9 100644 (file)
@@ -66,6 +66,8 @@ int navit_handle_button(struct navit *this_, int pressed, int button, struct poi
 void navit_handle_motion(struct navit *this_, struct point *p);
 void navit_zoom_in(struct navit *this_, int factor, struct point *p);
 void navit_zoom_out(struct navit *this_, int factor, struct point *p);
 void navit_handle_motion(struct navit *this_, struct point *p);
 void navit_zoom_in(struct navit *this_, int factor, struct point *p);
 void navit_zoom_out(struct navit *this_, int factor, struct point *p);
+void navit_zoom_in_cursor(struct navit *this_, int factor);
+void navit_zoom_out_cursor(struct navit *this_, int factor);
 struct navit *navit_new(struct attr *parent, struct attr **attrs);
 void navit_add_message(struct navit *this_, char *message);
 struct message *navit_get_messages(struct navit *this_);
 struct navit *navit_new(struct attr *parent, struct attr **attrs);
 void navit_add_message(struct navit *this_, char *message);
 struct message *navit_get_messages(struct navit *this_);