File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
MPChartLib/src/main/java/com/github/mikephil/charting/utils Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -342,7 +342,7 @@ open class ViewPortHandler {
342342 /* *
343343 * limits the maximum scale and X translation of the given matrix
344344 */
345- fun limitTransAndScale (matrix : Matrix , content : RectF ? ) {
345+ fun limitTransAndScale (matrix : Matrix , content : RectF ) {
346346 matrix.getValues(matrixBuffer)
347347
348348 val curTransX = matrixBuffer[Matrix .MTRANS_X ]
@@ -357,13 +357,8 @@ open class ViewPortHandler {
357357 // min scale-y is 1f
358358 scaleY = min(max(minScaleY.toDouble(), curScaleY.toDouble()), maxScaleY.toDouble()).toFloat()
359359
360- var width = 0f
361- var height = 0f
362-
363- if (content != null ) {
364- width = content.width()
365- height = content.height()
366- }
360+ val width: Float = content.width()
361+ val height: Float = content.height()
367362
368363 val maxTransX = - width * (scaleX - 1f )
369364 transX = min(max(curTransX.toDouble(), (maxTransX - transOffsetX).toDouble()), transOffsetX.toDouble()).toFloat()
You can’t perform that action at this time.
0 commit comments