|
@@ -134,11 +134,20 @@ open class SGraphyView(context: Context, attrs: AttributeSet? = null)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- val w = width.toFloat()
|
|
|
- val h = height.toFloat()
|
|
|
- val rect = scene!!.worldRect()
|
|
|
- setCenterPoint( PointF(rect.centerX(), rect.centerY()),
|
|
|
+ this.post {
|
|
|
+ val w = width.toFloat()
|
|
|
+ val h = height.toFloat()
|
|
|
+
|
|
|
+ val rect = scene!!.worldRect()
|
|
|
+ setCenterPoint( PointF(rect.centerX(), rect.centerY()),
|
|
|
min(w / rect.width(), h / rect.height()) * fitrate)
|
|
|
+ }
|
|
|
+
|
|
|
+// val w = width.toFloat()
|
|
|
+// val h = height.toFloat()
|
|
|
+// val rect = scene!!.worldRect()
|
|
|
+// setCenterPoint( PointF(rect.centerX(), rect.centerY()),
|
|
|
+// min(w / rect.width(), h / rect.height()) * fitrate)
|
|
|
} // Function FitView()
|
|
|
|
|
|
/**
|