summaryrefslogtreecommitdiff
path: root/navit/navit.c
diff options
context:
space:
mode:
Diffstat (limited to 'navit/navit.c')
-rw-r--r--navit/navit.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/navit/navit.c b/navit/navit.c
index 5248e10ea..f80890e2c 100644
--- a/navit/navit.c
+++ b/navit/navit.c
@@ -462,8 +462,27 @@ void navit_handle_resize(struct navit *this_, int w, int h) {
int callback=(this_->ready == 1);
this_->ready |= 2;
memset(&sel, 0, sizeof(sel));
+ int firstcall = 0;
+ struct attr attr;
+
+ /* Fix for #1135: Check if pitch was set while w and h were 0. In this case set pitch
+ * again so transformation value is set correctly */
+ if(this_->w==0 && this_->h==0) {
+ firstcall=1;
+ }
+
this_->w=w;
this_->h=h;
+
+ /* Fix for #1135: Now w and h are set initially, we can set pitch value again
+ *
+ */
+ if(firstcall) {
+ attr.type=attr_pitch;
+ attr.u.num=this_->pitch;
+ navit_set_attr(this_, &attr); // Set pitch again
+ }
+
sel.u.p_rect.rl.x=w;
sel.u.p_rect.rl.y=h;
transform_set_screen_selection(this_->trans, &sel);
@@ -2088,6 +2107,9 @@ int navit_init(struct navit *this_) {
struct attr *attr;
struct traffic * traffic;
+ this_->w=0;
+ this_->h=0;
+
dbg(lvl_info,"enter gui %p graphics %p",this_->gui,this_->gra);
if (!this_->gui && !(this_->flags & 2)) {