6.6.3 - Alpha - 修复 console.setContentTextColor 日志字体颜色异常 (issue #346)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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)))
|
||||
|
||||
Reference in New Issue
Block a user