-
Notifications
You must be signed in to change notification settings - Fork 400
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
Graphics.drawArc(), Graphics.fillArc() often fail on iOS, but never on Android #1878
Comments
I just figured out one piece of the puzzle, but the reason for the disappearance remains a mystery. I discovered that, when the images are visible, that's only in the application's start up screen. The images vanish when the startup screen goes away. (I discovered this when I added more images and made the screen scrollable. The images vanished as soon as the screen started scrolling. Which means when the app became operational.) Why they're not visible remains a mystery, but my suspicions have changed. I previously suspected that something was getting garbage collected incorrectly, and now I suspect the drawing code simply fails to draw them in the first place. |
I've had a similiar thing with images on IOS. And I never figured out what SwingGuy1024 notifications@github.com schrieb am Fr., 2. Sep. 2016 um
|
I just changed the test case to one with three similar images. One doesn't work at all, one partly works, and one works completely. This may help track down the problem. |
Here's my final test case, which narrows down the difference between success and failure to a single parameter. It turns out that if the Graphics.fillArc() method draws an arc with width == height, it works fine. But If it draws an arc where width > height, it doesn't draw anything. And if width < height, it draws incorrectly — it draws a circle with a diameter equal to the width, instead of an ellipse. This code demonstrates that behavior. It calls the same method five times, with different pairs of parameters. Two have width > height, two have width < height, and one has width == height. These lines are marked with comments. Here are two illustrations showing what it should draw (left) vs. what it draws (right). In each row, it shows first the raw image, then the mask to be applied, then the result after applying the mask. Note that in the top two rows, the ellipses don't draw at all in the right image, and that in the bottom two rows, they draw as circles. The left image shows how they should look.
|
I just did a test where I used drawArc() instead of fillArc(). With drawArc, when width < height, it still draw a circle, but when width > arc, it draws just a straight line across the middle of the ellipse. |
I just changed the title of this issue for clarity. |
I display some images that I created using Image.createImage(). In some cases, the images suddenly vanish from the screen, but only on iOS. The images are permanent on Android.
To reproduce, run the enclosed app on both Android and iOS. The app shows two images. The second one is taken from the bottom half of the first one. On Android, the images remain on the screen. On iOS, the images show up for about two to five seconds, then vanish. It turns out that they vanish when the app becomes active. They're only visible at the start because the startup image is visible. Further tests reveal that the images are the correct size, but are filled with transparent pixels.
I should say that, in my actual application, these images scale with the size of the screen, and are colored according to a user preference, so I can't get them from a resource.
(BTW Notice the change I made to the stop method. This is unrelated but worth mentioning.)
Here's the test case: This test case is improved from the original, because it shows three images, one of which doesn't work at all, one of which partly works, and one of which works completely.
The text was updated successfully, but these errors were encountered: