Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OnTouch Location error in Android #581

Closed
j4587698 opened this issue Jul 18, 2018 · 3 comments
Closed

OnTouch Location error in Android #581

j4587698 opened this issue Jul 18, 2018 · 3 comments
Milestone

Comments

@j4587698
Copy link

Description

if IgnorePixelScaling = true, the e.Location on Android will return a error numerical value.
the X and Y will increase at the same time if finger move down to the bottom of the screen.
but move the finger to the right of the screen, the X and Y will not increase.

Code

IgnorePixelScaling = true; in Constructor and
protected override void OnTouch(SKTouchEventArgs e) { base.OnTouch(e); e.Handled = true; Debug.WriteLine(e.Location); }

Actual Behavior

X increase in finger move to the right of the screen and Y increase in finger move to bottom of the screen.
if IgnorePixelScaling = false the behavior is right.

Basic Information

  • Version with issue: 1.60.2
  • IDE: Visual Studio
  • Platform Target Frameworks:
    • Android: 8.1
  • Target Devices:
    • Android 6.0 simulator and android 7.1 real machine
@j4587698
Copy link
Author

In SKCanvasViewRendererBase.cs line 167 x = Context.FromPixels(y); may be y = Context.FromPixels(y); and the same of line 170?

@mattleibow
Copy link
Contributor

@j4587698, That looks like the correct fix. Do you want to submit a PR? You should just need to sign the CLA (after opening the PR) and then you will get your name up in lights ;)

@mattleibow
Copy link
Contributor

I see you just did :)

@mattleibow mattleibow added this to the v1.60.3 milestone Jul 24, 2018
mattleibow added a commit that referenced this issue Jul 24, 2018
fix Android and Tizen Location error #581
@ghost ghost locked as resolved and limited conversation to collaborators Aug 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants