betaflight-configurator
betaflight-configurator copied to clipboard
Fixed wrapping with Artificial Horizon
This PR is to fixing an existing issue with artificial horizon wrapping in some situation. I did some regression testing as well with other single char elements like sidebar and stick overlay. No issue.
I think we should able to use one logic to apply to all osd elements:string, array of char and array of strings. String can be represented using array of string and its xMin, yMin is zero, xMax is the length of the longest element and yMax is the length of the array. Below can be the logic.
Proc OnDrop() {
Let x and y be the co-ord for the osd element, which is the left top corner.
Let x' and y' be the mouse cursor co-ord.
x'= position MOD osd.width
y'= position/osd.width
x = x' + xmin - element.x
y = y' + ymin - element.y
if ( y < 0 ) {
y = 0
}
if ( y + element.height > OSD.height ) {
y = y - element.height
}
if ( x < 0 ) {
x = 0
}
if ( x + element.width ) > OSD.width ) {
x = OSD.width - element.width
}
}
@dronejunkie: Yes, that sounds about right - what is neglected in the current code is proper calculation of the mouse cursor position relative to the element.
Sorry Michael, hopefully I will get sometime next week to completed this.
This issue / pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within a week.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within a week.
AUTOMERGE: (FAIL)
- Github identifies PR as mergeable -> FAIL
- Assigned to a milestone -> PASS
- cooling off period lapsed -> PASS
- commit count less or equal to three -> PASS
- 'Don't merge' label NOT found -> PASS
- At least one 'RN:' label found -> PASS
- 'Tested' label found -> FAIL
- assigned to an approver -> FAIL
- approver count at least three -> FAIL
Closing as inactive. Can be reopened when @dronejunkie decides to continue his work.
I'll reopen this - this is still a bug and needs to be fixed, and if somebody wants to spend some time on fixing this up it will be appreciated.
SonarCloud Quality Gate failed.
1 Bug
0 Vulnerabilities
1 Security Hotspot
600 Code Smells
No Coverage information
0.0% Duplication
@dronejunkie - Hi Jack - any chance you can review this again? It would be great to fix this for 4.3.
Hi Chris,
Due to work and other commitments I do not have time anymore. Sorry about that.
J.
On Sat, 4 Dec 2021, 10:18 am ctzsnooze, @.***> wrote:
@dronejunkie https://github.com/dronejunkie - Hi Jack - any chance you can review this again? It would be great to fix this for 4.3.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/betaflight/betaflight-configurator/pull/1324#issuecomment-985904964, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGA2NXHAPV7A4XT5WN3O4ADUPFF23ANCNFSM4G7GXOVA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
is this still required, or is master working as expected now that HD was done? if still required, need rebase from master and continued testing.