ShaMan123 / react-native-math-view

Math view for react native! No WebView!
https://github.com/ShaMan123/react-native-math-view
MIT License
77 stars 24 forks source link

MathView container styling between Android and iOS is inconsistent #93

Closed cyberjam closed 7 months ago

cyberjam commented 7 months ago

Hi ShaMan, Thanks for making this library. I'm looking at this issue.

Summary

Unlike iOS, height of MathView Component is set on Android.

Steps to reproduce

It was reproduced using MathView on mattermost mobile. (Due to the version conflict issue, I couldn't reproduce using the MathExmaple)

Expected behavior

MathView container styling of Android and ios should be consistent.

Observed behavior

Android (14.0) iOS (17.0)
image image

Possible fixes

There might be a problem with the android code and container style

ref : iOS code

Before : style={[styles.container, props.resizeMode === 'contain' && styles.contain, props.style]} After : style={[props.resizeMode === 'contain' && styles.contain, props.style]}

Android (Before) Android (After)
image image

(Tested on react-native-math-view - 3.9.5)

Thank you for reading. Happy New Year :)

cyberjam commented 7 months ago

To ensure consistent heights between Android and iOS, I'm considering using MathViewFallback instead of MathView.

What is the difference between MathView and MathViewFallback? As far as I know, MathViewFallback uses SVG. Is there a difference in performance?

ShaMan123 commented 7 months ago

I don't actively use or maintain this repo, I abadoned RN. Welcome to PR and/or join as a contributor. SVG is significantly slower if I recall correctly

cyberjam commented 7 months ago

Thank you for advice ;) Due to performance, I won't use MathViewFallback Component(SVG). I make PR(#94) about this issue to use MathView Component.