-
Notifications
You must be signed in to change notification settings - Fork 144
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
Obtain ImageData for any requested zoom value, not only autoscaled values #1713
Obtain ImageData for any requested zoom value, not only autoscaled values #1713
Conversation
a2785fe
to
9a9747e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me as if I had misunderstood the original intent of this change. It does not seem to be an actual bugfix but rather an improvement regarding which image data (more particularly, the image data at which scaling) to use for generating the one at the requested zoom level of. Is that correct?
Then of course the kind of test I proposed and is provided in this PR is not a regression test for the change. And probably it's something that we do not even need to test in that way at all.
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
tests/org.eclipse.swt.tests.win32/JUnit Tests/org/eclipse/swt/graphics/ImageWin32Tests.java
Outdated
Show resolved
Hide resolved
9a9747e
to
37514eb
Compare
In the previous implementation in case of integer 200 scaling, we only allowed the clients to retrieve the imageData of corrected zoom since our initial expectations were that we don't allow images to be created at, for example, the quarter zoom if the quarter scaling is disabled. But since we know that in some cases like Program icons we can get handles of image at these zoom levels, it doesnt make sense to restrict clients from requesting imagedata at certain zoom levels. In other words, this is indeed a feature enhancement as we are now allowing to store any zoom level in the handles map and retrieve them on demand. Hence, I would not consider this change as a bugfix but rather an improvement. But the tests do make sense to me since it validates the behaviour of getImageData at random zoom levels. It would not be considered a regression test but a feature test. |
This contribution helps retrieve the imageData for the requested zoom by searching for the zoom in the zoomToHandleMap followed by (if not available) scaling the handle at the zoom nearest to it while getting rid of only searching among the autoscaled zoom values. Contributes to eclipse-platform#62 and eclipse-platform#127
37514eb
to
6f047a5
Compare
This contribution helps retrieve the imageData for the requested zoom by searching for the zoom in the zoomToHandleMap followed by (if not available) scaling the handle at the zoom nearest to it while getting rid of only searching among the autoscaled zoom values.
Contributes to #62 and #127