Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upProblem transitioning to `Plain` image from other image types #550
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
evancz
May 11, 2016
Member
Sorry for the slow reply. It has been busy times. All the Graphics.* modules have moved to evancz/elm-graphics so it makes sense to retarget stuff like this.
|
Sorry for the slow reply. It has been busy times. All the |
evancz
closed this
May 11, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rgrempel commentedApr 5, 2016
There is a bug here which would create a problem if someone were to try to transition to a
Plainimage type from any other image type (e.g.Fitted).https://github.com/elm-lang/core/blob/3.0.0/src/Native/Graphics/Element.js#L486-L493
This code appears to optimize the case where it is only the
srcattribute which is changing. In that case, it is not necessary to recreate the DOM node -- once can just change thesrcattribute (and, of course, apply other property updates, but that is not relevant here).The problem is that the code only checks the type of the image which we are transitioning to -- it ignores the type of the image we are transitioning from. The optimization only makes sense if we are transitioning from a
Plainimage to anotherPlainimage. If, for instance, we are transitioning from aFittedimage to aPlainimage, then the structure of the DOM is completely different -- updating thesrcattribute will not accomplish anything.One way to fix this would be to change the conditional to something like:
Of course, there may be other ways.
It is possible that no one has ever encountered this bug, since it is probably unusual to transition from one image type to another. Therefore, one might not consider this to be a high priority bug to fix.