make stack start at top to prevent scrolling issue
This commit is contained in:
@@ -23,10 +23,14 @@ class EditorView : View("Befide") {
|
||||
}
|
||||
|
||||
init {
|
||||
codeView.src = """ 2>:3g" "-!v\ g30 <
|
||||
|!`"O":+1_:.:03p>03g+:"O"`|
|
||||
@ ^ p3\" ":<
|
||||
2 234567890123456789012345678901234567890123456789012345678901234567890123456789"""
|
||||
codeView.src = """v ;11101010;
|
||||
>>>>>>>>>>>>>55+0g68*-90g68*-2*+80g68*-4*+70g68*-8*+v
|
||||
@.+***288-*86g03+**88-*86g04+**84-*86g05+**44-*86g06<"""
|
||||
|
||||
// codeView.src = """ 2>:3g" "-!v\ g30 <
|
||||
// |!`"O":+1_:.:03p>03g+:"O"`|
|
||||
// @ ^ p3\" ":<
|
||||
//2 234567890123456789012345678901234567890123456789012345678901234567890123456789"""
|
||||
|
||||
// codeView.src = """"hello world",,,,,,,,,,,@"""
|
||||
}
|
||||
|
||||
@@ -19,9 +19,11 @@ class StackView(val interp: Interpreter) : View() {
|
||||
textarea(charOutProperty) {
|
||||
maxWidth = 1.0
|
||||
paddingHorizontal = 1
|
||||
prefRowCount = interp.funge.height
|
||||
isEditable = false
|
||||
}
|
||||
textarea(longOutProperty) {
|
||||
prefRowCount = interp.funge.height
|
||||
prefWidth = 90.0
|
||||
isEditable = false
|
||||
}
|
||||
@@ -29,18 +31,18 @@ class StackView(val interp: Interpreter) : View() {
|
||||
|
||||
private fun <T> getStackStr(mapping: (Value) -> T): String {
|
||||
return interp.stack.takeLast(interp.funge.height)
|
||||
.map (mapping)
|
||||
.map(mapping)
|
||||
.padEnd(interp.funge.height, "")
|
||||
.reversed()
|
||||
// .reversed()
|
||||
.joinToString("\n")
|
||||
}
|
||||
|
||||
init {
|
||||
charOut = getStackStr { it.asChar ?: '*'}
|
||||
charOut = getStackStr { it.asChar ?: '*' }
|
||||
longOut = getStackStr { it.value }
|
||||
|
||||
interp.stackChanged += {
|
||||
charOut = getStackStr { it.asChar ?: '*'}
|
||||
charOut = getStackStr { it.asChar ?: '*' }
|
||||
longOut = getStackStr { it.value }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
.code, .text-area {
|
||||
-fx-font-family: Consolas, monospace;
|
||||
-fx-text-fill: black;
|
||||
-fx-font-size: 18;
|
||||
}
|
||||
|
||||
.code-view, .text-area {
|
||||
@@ -35,7 +36,7 @@
|
||||
-fx-text-fill: #ffa235;
|
||||
}
|
||||
|
||||
.code-stop{
|
||||
.code-stop {
|
||||
-fx-font-weight: bold;
|
||||
-fx-text-fill: #990208;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user