AndroidMath icon indicating copy to clipboard operation
AndroidMath copied to clipboard

How to get actual render size?

Open mikeroneer opened this issue 5 years ago • 1 comments
trafficstars

Is it possible to get the bounding box of the actual rendered content, meaning the height and the width from the canvas?

mikeroneer avatar Apr 02 '20 21:04 mikeroneer

To get the dimensions of the MTMathView element, use that :

your_MTMathView_element.viewTreeObserver.addOnDrawListener {
            val elementWidth = your_MTMathView_element.measuredWidth
            val elementHeight = your_MTMathView_element.measuredHeight
}

clementwzk avatar Aug 16 '23 13:08 clementwzk