Opened 8 years ago

Closed 5 years ago

#990 closed defect/bug (fixed)

Percent position for osd items not working until rotaing the device

Reported by: me.yahoo.com/a/t8pxanggmzrce9fscf2wgwk_ozmtbyifgarr#f3b4e Owned by: KaZeR
Priority: major Milestone: version 0.5.1
Component: core Version: git master
Severity: normal Keywords: osd position percent display
Cc: sebastian.leske@…

Description

  • Navit version: navit-svn-4871
  • Device: Samsung Galaxy Tab P1000
  • OS: Android 2.2

As described at http://wiki.navit-project.org/index.php/OSD#Position The position of an element is specified in x and y pixels or percent of screen height/width

The problem is that setting position as percent does not work immediately after staring navit. When setting the position as percent, the OSD item will be drawn at position 0 0 (top-left corner) If rotating the device (from vertical to horizontal or vice versa) the item will be displayed at correct position.

I have an example below. I have a scale in my navit.xml. It is positioned at x=0 and y= 50%. This is left side, halh hight.

<osd enabled="yes" x="0" y="50%" w="250" h="60" font_size="400" type="scale" use_overlay="1" background_color="#48852fa0" align="1"/>

Navit is started with device on vertical orientation. Scale is positioned top-left. See attached scale-bad.png screenshot.

If rotating the device horizontally, scale will be positioned correctly. If rotating the screen back to vertical orientation, scale will be positioned correctly. See attached scale-good.png screenshot.

Attachments (2)

scale-bad.png (165.1 KB) - added by me.yahoo.com/a/t8pxanggmzrce9fscf2wgwk_ozmtbyifgarr#f3b4e 8 years ago.
scale displayed bad
scale-good.png (147.9 KB) - added by me.yahoo.com/a/t8pxanggmzrce9fscf2wgwk_ozmtbyifgarr#f3b4e 8 years ago.
scale displayed good

Download all attachments as: .zip

Change History (11)

Changed 8 years ago by me.yahoo.com/a/t8pxanggmzrce9fscf2wgwk_ozmtbyifgarr#f3b4e

scale displayed bad

Changed 8 years ago by me.yahoo.com/a/t8pxanggmzrce9fscf2wgwk_ozmtbyifgarr#f3b4e

scale displayed good

comment:1 follow-up: Changed 8 years ago by korrosa

I'm gonna go out on a limb here and suggest that this is entirely related to #983.

comment:2 in reply to: ↑ 1 Changed 8 years ago by me.yahoo.com/a/t8pxanggmzrce9fscf2wgwk_ozmtbyifgarr#f3b4e

The problems are very similar:

  • #990 is about setting OSD item position as percent
  • #983 is about setting OSD item size as percent

Ciprian.

Replying to http://wiki.navit-project.org/index.php/user:korrosa:

I'm gonna go out on a limb here and suggest that this is entirely related to #983.

comment:3 Changed 8 years ago by korrosa

Indeed - latest comments in #983 suggest that the percent attribute is honoured when the window size of Navit is altered. This ticket seems to suggest that the percent attribute is honoured when the orientation of the device is altered, which is effectively changing the window size of Navit. Whether it's position or size I don't think matters - the fix for one will probably fix the other.

I guess what I'm trying to say in too many words:

  • The problems are similar - I think the solution is the same.
  • Keep an eye on #983 if no-one replies to this ticket. Because two different problems are described this ticket won't be marked as duplicate, but I guess we shouldn't expect sleske to update two tickets!

comment:4 follow-up: Changed 8 years ago by sleske

Actually, I can keep an eye on both tickets :-).

And yes, this is most probably the same problem as #983 - the same callback is invoked for rotation and resizing of the window, and this callback then corrects the percent positions.

We can keep both tickets open for now. If I manage to resolve 983, we'll see if this problem goes away as well.

comment:5 Changed 8 years ago by sleske

  • Cc sebastian.leske@… added

comment:6 in reply to: ↑ 4 Changed 8 years ago by me.yahoo.com/a/t8pxanggmzrce9fscf2wgwk_ozmtbyifgarr#f3b4e

Thanks, Sebastian.

Ciprian.

Replying to http://sleske.myopenid.com/:

Actually, I can keep an eye on both tickets :-).

And yes, this is most probably the same problem as #983 - the same callback is invoked for rotation and resizing of the window, and this callback then corrects the percent positions.

We can keep both tickets open for now. If I manage to resolve 983, we'll see if this problem goes away as well.

comment:7 Changed 7 years ago by sleske

Just a note: I committed a (partial?) fix for #983 (see there). Can someone retest with latest SVN, to check if this bug is fixed by the checkin?

Last edited 7 years ago by sleske (previous) (diff)

comment:8 Changed 6 years ago by usul

  • Keywords display added
  • Milestone set to version 0.5.1

Needs to be tested again on all devices if bug still occurs.

As this is unexpected behaviour of existing functionality, I will schedule it for next minor hotfix.

comment:9 Changed 5 years ago by mvglasow (2)

  • Resolution set to fixed
  • Severity set to normal
  • Status changed from new to closed

The original issue in #983 got fixed in r5901. The patch fixes both relative size and position.

Note: See TracTickets for help on using tickets.