Opened 8 years ago
Closed 8 years ago
#1267 closed defect/bug (fixed)
Android: text OSD does not resize correctly when rotating
Reported by: | mvglasow (2) | Owned by: | mvglasow (2) |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | port/android | Version: | git master |
Severity: | normal | Keywords: | Android, OSD, text |
Cc: |
Description
Steps to reproduce:
- Add the following OSD item: <osd type="text" label="Test" x="0" y="0" w="100%" h="54" font_size="800" background_color="#000000a0"/>
- Start Navit
- Rotate the device by 90 degrees so that orientation changes
Observations:
- When Navit starts in portrait mode and then changes to landscape, the OSD item maintains its old width and is aligned to the left edge. Text is placed in the middle of the screen (not the background) and any text extending beyond the right edge of the box is cut off.
- When Navit starts in landscape mode, the OSD item renders correctly. Even after a few rotations it will display correctly in either orientation.
Apparently the width of the background is determined once at startup and not updated when the display orientation changes. Text placement seems to requery this value every time.
Change History (3)
comment:1 Changed 8 years ago by mvglasow (2)
comment:2 Changed 8 years ago by mvglasow (2)
- Component changed from core to port/android
comment:3 Changed 8 years ago by mvglasow (2)
- Resolution set to fixed
- Status changed from new to closed
Resolved in r5915.
Note: See
TracTickets for help on using
tickets.
As it turns out, org.navitproject.navit.NavitGraphics#overlayResize() doesn't do anything other than setting pos_x and pos_y. So while the generic draw routines work correctly, they are drawing onto a canvas that still has the old dimensions. Copying in some code from the constructor to recreate the bitmap and assign it to the canvas fixes that.