This repository has been archived by the owner on Feb 6, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
原因:svga 是由多张图片构成,图片有大有小。外界传递进来的宽高当前View 使用的期望宽高,将svga 中的所有图片根据同一个宽高去进行采样率计算明显不合理。比如 一张svga 包含三张图片假设三张图都是正方向 他们的宽度分别是800、400、200 期望大小是200 那么计算出的采样率分别是 4、2、1 那么在进行图片获取的时候会将三张图片最终加载成同样大小。
解决方式:读取svga 最外层的实际大小,以此作为基础与期望的图片大小进行采样率计算。然后svga内部的所有图片按照这个采样率进行采样