betaflight-configurator icon indicating copy to clipboard operation
betaflight-configurator copied to clipboard

Fixed wrapping with Artificial Horizon

Open dronejunkie opened this issue 5 years ago • 12 comments

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.

dronejunkie avatar Mar 18 '19 12:03 dronejunkie

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 avatar Mar 25 '19 10:03 dronejunkie

@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.

mikeller avatar Mar 25 '19 16:03 mikeller

Sorry Michael, hopefully I will get sometime next week to completed this.

dronejunkie avatar Mar 31 '19 05:03 dronejunkie

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.

stale[bot] avatar Apr 30 '19 05:04 stale[bot]

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.

github-actions[bot] avatar Jan 08 '21 05:01 github-actions[bot]

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

blckmn avatar Jun 18 '21 00:06 blckmn

Closing as inactive. Can be reopened when @dronejunkie decides to continue his work.

haslinghuis avatar Jul 06 '21 20:07 haslinghuis

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.

mikeller avatar Oct 10 '21 11:10 mikeller

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell E 600 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Oct 10 '21 12:10 sonarqubecloud[bot]

@dronejunkie - Hi Jack - any chance you can review this again? It would be great to fix this for 4.3.

ctzsnooze avatar Dec 03 '21 23:12 ctzsnooze

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.

dronejunkie avatar Dec 05 '21 05:12 dronejunkie

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.

nerdCopter avatar Nov 17 '23 17:11 nerdCopter