Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- READ ME FIRST: Please fill in the explanation section below and check off every point from the Essential Checklist! --> ## Explanation Fixes oppia#5112 We discovered that `mathImg_` dimesions are in **ex**, and not **px**, and this unit is not natively rendered on android. This PR introduces a method that will convert ex to px and use the resulting dimesions to compute the rendering size of a math image to be rendered inline. The formula is based on the [androidSvg library](https://github.com/oppia/androidsvg/blob/5bc9c7553e94c3476e8ea32baea3c77567228fcd/androidsvg/src/main/java/com/caverock/androidsvg/androidrendering/SVGAndroidRenderer.java#L5018) that is also based on CSS3 specs. To preserve the size computation of block SVGs, we have created a seperate method that handles the calculation of rendering dimensions for inline SVGs. We have only tested these changes through visual observation, and confirming that the images scale correctly when reading text size is changed. ## Essential Checklist <!-- Please tick the relevant boxes by putting an "x" in them. --> - [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".) - [x] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation. - [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide). - [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)). - [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop". - [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)). ## For UI-specific PRs only |Before|After| |--|--| ||| ||| ||| ||| ||| Images scaled to Largest text and display size, and dark mode |||| |--|--|--| |||| |||| --------- Co-authored-by: Ben Henning <ben@oppia.org>