6.6.3 - Alpha - 修复 console.setContentTextColor 日志字体颜色异常 (issue #346)

This commit is contained in:
SuperMonster003
2025-04-17 18:42:31 +08:00
parent bd16b3590c
commit 102c058226
4 changed files with 12 additions and 8 deletions

View File

@@ -4,7 +4,8 @@
"released_date": "2025/04/17",
"fix": [
"主页文档标签显示在线文档时部分内容被系统导航栏遮挡的问题",
"部分设备代码编辑器空行显示方框字符的问题"
"部分设备代码编辑器空行显示方框字符的问题",
"console.setContentTextColor 方法导致日志字体颜色丢失默认值的问题 _[`issue #346`](http://issues.autojs6.com/346)_"
]
},
"v6.6.2": {

View File

@@ -632,7 +632,7 @@ open class ConsoleImpl(val uiHandler: UiHandler) : AbstractConsole() {
fun getContentTextSize() = getFloatingConsoleView()?.textSize ?: 0f
@ScriptInterface
fun setContentTextColors(colors: Array<out Int>) = runWithWindow({ configurator.setContentTextColors(colors) }) {
fun setContentTextColors(colors: Array<out Int?>) = runWithWindow({ configurator.setContentTextColors(colors) }) {
getFloatingConsoleView()?.setTextColors(colors)
}
@@ -859,7 +859,7 @@ open class ConsoleImpl(val uiHandler: UiHandler) : AbstractConsole() {
private set
@Volatile
var contentTextColors: Array<out Int>? = null
var contentTextColors: Array<out Int?>? = null
private set
@Volatile
@@ -923,7 +923,7 @@ open class ConsoleImpl(val uiHandler: UiHandler) : AbstractConsole() {
contentTextSize = size
}
fun setContentTextColors(colors: Array<out Int>) = also {
fun setContentTextColors(colors: Array<out Int?>) = also {
contentTextColors = colors
}

View File

@@ -410,10 +410,13 @@ class Console(scriptRuntime: ScriptRuntime) : AugmentableProxy(scriptRuntime) {
when (argList.size) {
1 -> when (val o = argList[0]) {
is NativeArray -> {
scriptRuntime.console.setContentTextColors(o.map { S13n.color(arrayOf(it)) }.toTypedArray())
val tmp = Array(6) { index ->
if (index < o.size) S13n.color(arrayOf(o[index])) else null
}
scriptRuntime.console.setContentTextColors(tmp)
}
is NativeObject -> {
val tmp = Array(6) { 0 }
val tmp = Array<Int?>(6) { null }
listOf("verbose", "log", "info", "warn", "error", "assert").forEachIndexed { index, key ->
if (o.hasProp(key)) {
tmp[index] = S13n.color(arrayOf(o.prop(key)))

View File

@@ -1,5 +1,5 @@
#Thu Apr 17 18:03:05 CST 2025
BUILD_TIME=1744884185114
#Thu Apr 17 18:34:12 CST 2025
BUILD_TIME=1744886052185
COMPILE_SDK_VERSION=35
JAVA_VERSION=23
JAVA_VERSION_MIN_RADICAL=0