diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/QueryTTF.kt b/app/src/main/java/io/legado/app/model/analyzeRule/QueryTTF.kt index c49bbd48d..4ddcff34e 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/QueryTTF.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/QueryTTF.kt @@ -8,7 +8,10 @@ import kotlin.experimental.and * @see 获取详情 * @see 基于Javascript的TTF解析器 */ -@Suppress("unused", "RedundantExplicitType", "MemberVisibilityCanBePrivate") +@Suppress( + "unused", "RedundantExplicitType", "MemberVisibilityCanBePrivate", + "EqualsBetweenInconvertibleTypes", "ControlFlowWithEmptyBody" +) @ExperimentalUnsignedTypes class QueryTTF(var font: ByteArray) : JsExtensions { data class Index(var num: Int) @@ -385,31 +388,31 @@ class QueryTTF(var font: ByteArray) : JsExtensions { } // 获取x轴相对坐标 g.xCoordinates = Array(flagLength) { 0 } - for (n in 0 until flagLength) { - val xByte = !(g.flags[n] and 0x02).equals(0) - val xSame = !(g.flags[n] and 0x10).equals(0) + for (m in 0 until flagLength) { + val xByte = !(g.flags[m] and 0x02).equals(0) + val xSame = !(g.flags[m] and 0x10).equals(0) if (xByte) { - g.xCoordinates[n] = + g.xCoordinates[m] = ((if (xSame) 1 else -1) * data.copyOfIndex(1).first()).toShort() } else { - if (xSame) g.xCoordinates[n] = 0 + if (xSame) g.xCoordinates[m] = 0 else { - g.xCoordinates[n] = byteArrToUintx(data.copyOfIndex(2)).toShort() + g.xCoordinates[m] = byteArrToUintx(data.copyOfIndex(2)).toShort() } } } // 获取y轴相对坐标 g.yCoordinates = Array(flagLength) { 0 } - for (n in 0 until flagLength) { - val yByte = !(g.flags[n] and 0x04).equals(0) - val ySame = !(g.flags[n] and 0x20).equals(0) + for (m in 0 until flagLength) { + val yByte = !(g.flags[m] and 0x04).equals(0) + val ySame = !(g.flags[m] and 0x20).equals(0) if (yByte) { - g.yCoordinates[n] = + g.yCoordinates[m] = ((if (ySame) 1 else -1) * data.copyOfIndex(1).first()).toShort() } else { - if (ySame) g.yCoordinates[n] = 0 + if (ySame) g.yCoordinates[m] = 0 else { - g.yCoordinates[n] = byteArrToUintx(data.copyOfIndex(2)).toShort() + g.yCoordinates[m] = byteArrToUintx(data.copyOfIndex(2)).toShort() } } }