ArduPilot / ArduPilot/MissionPlanner
At CustomMessageBox.cs line 98 SizeF should be Size type
- Dominant language
- C#
- Stars
- 2.4k
- Forks
- 2.9k
- Avg merge
- 19h 16m
- Merged PRs (30d)
- 4
Description
#### Issue details
At CustomMessageBox.cs ,
line 98 : SizeF sz = TextRenderer.MeasureText ("The quick brown Fox", SystemFonts.DefaultFont);
At the program, the return of TextRenderer.MeasureText , is Size type .
When using MissionPlannerLib.sln, debugging using Andorid 10 mobile phone, it reports problems at line 101:
text = AddNewLinesToText(text, Screen.PrimaryScreen.Bounds.Width / (int)perchar);
The message is “find divided by zero”.
When debug using Android 7 mobile, there's no problem .
After changed line 98 , SizeF to Size , the debug at Andorid 10 mobile phone ran good.
#### Version
I've been download the latest files , at 2023.9.10 .
#### Platform
[ ] All
[ ] AntennaTracker
[ Yes ] Copter
[ ] Plane
[ ] Rover
[ ] Sub
#### Airframe type
None.
#### Hardware type
Just practice at mobile phone software , is about to use it at APM2.8 hardware.
#### Logs
None.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in CustomMessageBox.cs at line 98 and inspect how the SizeF result from TextRenderer.MeasureText is used before line 101. Reproduce the issue with MissionPlannerLib.sln on Android 10, then verify the text wrapping path no longer divides by zero while Android 7 behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100