summaryrefslogtreecommitdiff
path: root/navit
diff options
context:
space:
mode:
authorOLFDB <olf@eisenzelt.de>2021-08-31 12:15:10 +0200
committerGitHub <noreply@github.com>2021-08-31 12:15:10 +0200
commit0cd682b76418deb0c52bb7244ac631994286f79f (patch)
tree794a996b7537023d4c76cf5885f7d0652234ea6b /navit
parente0e21a0974b0356e13926dab14ef7dd66dfac9bb (diff)
downloadnavit-0cd682b76418deb0c52bb7244ac631994286f79f.tar.gz
fix:core:Fix #1135 (#1136)
* Fix #1135 * Revert "Fix #1135" This reverts commit 585ab7bbe2020b574e35ce08153ff2991131b3f3. * Revert "Revert "Fix #1135"" This reverts commit 97ff13fa761a884019e341dd77e62a2735b52213.
Diffstat (limited to 'navit')
-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)) {