当我绘制此矢量可绘制对象时,我在 android 上的 PathParser 中出现错误
<vector android:height="24dp" android:viewportHeight="667.0"
android:viewportWidth="667.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillAlpha="1" android:fillColor="#f06927"
android:pathData="M333.5,333.5m-333.5,0a333.5,333.5 0,1 1,667 0a333.5,333.5 0,1 1,-667 0"
android:strokeAlpha="1" android:strokeColor="#00000000"
android:strokeLineCap="butt" android:strokeLineJoin="miter" android:strokeWidth="1"/>
</vector>
这是错误(得到两次)
12-06 17:06:36.273 28351-28351/com.dakota.vectorpreview W/PathParser: Points are too far apart 4.000000000000001
这是评估 4.000000000000001的Android 源代码(第 415 行)
/* Compute differences and averages */
double dx = x0p - x1p;
double dy = y0p - y1p;
double dsq = dx * dx + dy * dy;
double disc = 1.0 / dsq - 1.0 / 4.0;
if (disc < 0.0) {
Log.w(LOGTAG, "Points are too far apart " + dsq);
float adjust = (float) (Math.sqrt(dsq) / 1.99999);
drawArc(p, x0, y0, x1, y1, a * adjust,
b * adjust, theta, isMoreThanHalf, isPositiveArc);
return; /* Points are too far apart */
}
据我所知,它正确地绘制到屏幕上。这似乎是一个错误,而不是编码错误。
编辑:我正在寻找一种方法来解决这个答案,而不是解释它为什么会发生。