summaryrefslogtreecommitdiff
path: root/navit/navit.c
diff options
context:
space:
mode:
authorJohan FitiƩ <jfitie@gmail.com>2017-08-01 21:26:38 +0200
committerPierre GRANDIN <pgrandin@users.noreply.github.com>2017-08-01 12:26:38 -0700
commitfe72380925d56323f825c28b382527691a66e8c8 (patch)
tree3771774ff3fe3e432e558f6079423990b7b67796 /navit/navit.c
parent48f4f856a8b2fd2dcff0432b3e76fc716f3dd4f9 (diff)
downloadnavit-fe72380925d56323f825c28b382527691a66e8c8.tar.gz
Auto pitch and orientation (#306)
* Initial commit * Use original pitch when autozoom is not active * Apply pitch correction in reverse when reading attribute * Always show zoom in and out buttons * Remove space before closing tag
Diffstat (limited to 'navit/navit.c')
-rw-r--r--navit/navit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/navit/navit.c b/navit/navit.c
index 120b96049..fa2db9926 100644
--- a/navit/navit.c
+++ b/navit/navit.c
@@ -2596,7 +2596,7 @@ navit_set_attr_do(struct navit *this_, struct attr *attr, int init)
case attr_pitch:
attr_updated=(this_->pitch != attr->u.num);
this_->pitch=attr->u.num;
- transform_set_pitch(this_->trans, ceil(this_->pitch*sqrt(240*320)/sqrt(this_->w*this_->h))); // Pitch corrected for window resolution
+ transform_set_pitch(this_->trans, round(this_->pitch*sqrt(240*320)/sqrt(this_->w*this_->h))); // Pitch corrected for window resolution
if (!init && attr_updated && this_->ready == 3)
navit_draw(this_);
break;
@@ -2836,7 +2836,7 @@ navit_get_attr(struct navit *this_, enum attr_type type, struct attr *attr, stru
attr->u.num=this_->osd_configuration;
break;
case attr_pitch:
- attr->u.num=transform_get_pitch(this_->trans);
+ attr->u.num=round(transform_get_pitch(this_->trans)*sqrt(this_->w*this_->h)/sqrt(240*320)); // Pitch corrected for window resolution
break;
case attr_projection:
if(this_->trans) {