-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Canvas GetPixelColor Removes Container Positioning #2673
Comments
The example aia file doesn't seem to be a real aia file. Could you re upload in aia file format? Thanks |
@daki7711 I think GitHub doesn't support |
@preetvadaliya Thanks |
@TimCarterLinux would it be possible for us to know which android version you used for this? Thanks |
If I remember correctly on Android 10 (Genymotion Emulator) and Android 12 Google Pixel 4a (it may have been Android 11 at the time) |
@TimCarterLinux thanks, does this problem still happen? Cause I wasn't able to replicate this problem with my device. Trying to figure out where the problem is stemming from |
Just retested on devices as above, and the problem still exists on both |
This is very strange, would it be possible that you re-upload the hland.jpg in your aia file? Cause I did ran into some trouble when using your hland.jpg and it started to work fine after downloading it and re-uploading it |
I tried re-uploaded the hland.jpg image, I even tried with a completely different image (and removing hland.jpg from the project), the same thing happens |
@TimCarterLinux I think the first thing for me is to find a device that has the same problem. Until now all the devices (three chromebooks, two android tablet, one ipad) I tested works fine with this aia. Have you ever experience something similar with a different aia? |
I just tried it on my chromebook, and like you say no problem. Could possibly be an issue with My computer (Linux Xubuntu 20.04) and Chromium browser ? Just tested with Firefox and the problem persists. |
I see, interesting. Definitely worth checking out browsers. Thanks for cooperating. @ewpatton what is your take on this? |
@daki7711 Have you figure out anything related this? I think what is happening there when we call GetPixelColor(x, y) it will build a cache of canvas's bitmap and then returns us a color, but after getting the color we are actually re drawing the canvas using that cache and this is creating a problem. But i am not sure maybe @ewpatton can help you more. |
@daki7711 please look at this method I am sure you will definitely find something realted this here. Especially on this line... appinventor-sources/appinventor/components/src/com/google/appinventor/components/runtime/Canvas.java Line 448 in 77882bb
|
@preetvadaliya thanks for that, at the moment I'm struggling to replicate the problem with my devices though |
@ewpatton Do you think it is worth investigating different browsers? |
@preetvadaliya @ewpatton is this still open, I will like to work on this |
@preetvadaliya @ewpatton, how can i view the Logs mad by |
To see logs, you need to use |
Already tried it but when adb logcat running it is killing the companion mode and when companion mode is running it is killing adb logcat process. |
Are you running in the emulator? |
No I am using real device, But i have separately downloaded the adb than running it from terminal |
I'm not sure I understand what you're saying. adb is a command line tool. The best thing to do is set it up so that adb is on your PATH and then use it in the terminal. Generally, you don't need adb to run the companion (you do need it to install changes). If you're using USB or the emulator, rather than Wifi, to connect, then you will need to make sure that you copy whichever version of adb and replace the version installed by App Inventor's setup tools package. |
I want to contribute in issue please assign me |
@Vickyaryan33 @arinmodi has already submitted a pull request that may address this issue. Please look for other issues marked help wanted for potential first contributions. |
Describe the bug
Screen set to Landscape in Designer (same issue when Portrait)
A vertical arrangement Centre/Centre
A canvas with dimensions larger than the vertical arrangement, inside the vertical arrangement
An imagesprite, centred to the canvas
If the GetPixelColor block is run on any x,y coordinates, the color is returned, but the vertical arrangement loses its centre/centre setting and the canvas is set to 0,0 in the vertical arrangement. I have found that if the imageSprite is set to larger than the vertical arrangement, the same issue occurs but drag functionality on the imageSprite is also lost.
Affects
Expected behavior
Run the GetPixelColor block, which returns the colour, and all elements and positioning remains unchanged.
Steps to reproduce
Screen set to Landscape in Designer (same issue when Portrait)
A vertical arrangement Centre/Centre
A canvas with dimensions larger than the vertical arrangement, inside the vertical arrangement
An imagesprite, centred to the canvas
Request getPixelColor of the middle pixel of the canvas (or any other position)
Canvas moves to 0,0 of vertical arrangement, is no longer centred, and dragging of imageSprite can also be affected.
(This doesn't seem to be related to the "really large canvas bug, #2404", canvas only set to 600x800 in a 300x400 VA.)
Example aia
dragImagebug.aia.zip
The text was updated successfully, but these errors were encountered: