@@ -3,6 +3,7 @@ package com.opensource.svgaplayer
3
3
import android.graphics.Color
4
4
import android.graphics.Matrix
5
5
import android.graphics.Path
6
+ import android.graphics.RectF
6
7
import android.os.Build
7
8
8
9
import org.json.JSONArray
@@ -169,12 +170,7 @@ class SVGAVideoShapeEntity(obj: JSONObject) {
169
170
val y = yv.toFloat()
170
171
val rx = rxv.toFloat()
171
172
val ry = ryv.toFloat()
172
- if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .LOLLIPOP ) {
173
- aPath.addOval(x - rx, y - ry, x + rx, y + ry, Path .Direction .CW )
174
- }
175
- else if (Math .abs(rx - ry) < 0.1 ) {
176
- aPath.addCircle(x, y, rx, Path .Direction .CW )
177
- }
173
+ aPath.addOval(RectF (x - rx, y - ry, x + rx, y + ry), Path .Direction .CW )
178
174
}
179
175
else if (this .type == SVGAVideoShapeEntity .Type .rect) {
180
176
val xv = this .args?.get(" x" ) as ? Number ? : return
@@ -187,12 +183,7 @@ class SVGAVideoShapeEntity(obj: JSONObject) {
187
183
val width = wv.toFloat()
188
184
val height = hv.toFloat()
189
185
val cornerRadius = crv.toFloat()
190
- if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .LOLLIPOP ) {
191
- aPath.addRoundRect(x, y, x + width, y + height, cornerRadius, cornerRadius, Path .Direction .CW )
192
- }
193
- else {
194
- aPath.addRect(x, y, x + width, y + height, Path .Direction .CW )
195
- }
186
+ aPath.addRoundRect(RectF (x, y, x + width, y + height), cornerRadius, cornerRadius, Path .Direction .CW )
196
187
}
197
188
this .shapePath = aPath
198
189
}
0 commit comments