make stack start at top to prevent scrolling issue

This commit is contained in:
2018-11-25 23:26:23 -05:00
parent 1eefc31cfe
commit dd73965e39
3 changed files with 16 additions and 9 deletions

View File

@@ -23,10 +23,14 @@ class EditorView : View("Befide") {
} }
init { init {
codeView.src = """ 2>:3g" "-!v\ g30 < codeView.src = """v ;11101010;
|!`"O":+1_:.:03p>03g+:"O"`| >>>>>>>>>>>>>55+0g68*-90g68*-2*+80g68*-4*+70g68*-8*+v
@ ^ p3\" ":< @.+***288-*86g03+**88-*86g04+**84-*86g05+**44-*86g06<"""
2 234567890123456789012345678901234567890123456789012345678901234567890123456789"""
// codeView.src = """ 2>:3g" "-!v\ g30 <
// |!`"O":+1_:.:03p>03g+:"O"`|
// @ ^ p3\" ":<
//2 234567890123456789012345678901234567890123456789012345678901234567890123456789"""
// codeView.src = """"hello world",,,,,,,,,,,@""" // codeView.src = """"hello world",,,,,,,,,,,@"""
} }

View File

@@ -19,9 +19,11 @@ class StackView(val interp: Interpreter) : View() {
textarea(charOutProperty) { textarea(charOutProperty) {
maxWidth = 1.0 maxWidth = 1.0
paddingHorizontal = 1 paddingHorizontal = 1
prefRowCount = interp.funge.height
isEditable = false isEditable = false
} }
textarea(longOutProperty) { textarea(longOutProperty) {
prefRowCount = interp.funge.height
prefWidth = 90.0 prefWidth = 90.0
isEditable = false isEditable = false
} }
@@ -29,18 +31,18 @@ class StackView(val interp: Interpreter) : View() {
private fun <T> getStackStr(mapping: (Value) -> T): String { private fun <T> getStackStr(mapping: (Value) -> T): String {
return interp.stack.takeLast(interp.funge.height) return interp.stack.takeLast(interp.funge.height)
.map (mapping) .map(mapping)
.padEnd(interp.funge.height, "") .padEnd(interp.funge.height, "")
.reversed() // .reversed()
.joinToString("\n") .joinToString("\n")
} }
init { init {
charOut = getStackStr { it.asChar ?: '*'} charOut = getStackStr { it.asChar ?: '*' }
longOut = getStackStr { it.value } longOut = getStackStr { it.value }
interp.stackChanged += { interp.stackChanged += {
charOut = getStackStr { it.asChar ?: '*'} charOut = getStackStr { it.asChar ?: '*' }
longOut = getStackStr { it.value } longOut = getStackStr { it.value }
} }
} }

View File

@@ -6,6 +6,7 @@
.code, .text-area { .code, .text-area {
-fx-font-family: Consolas, monospace; -fx-font-family: Consolas, monospace;
-fx-text-fill: black; -fx-text-fill: black;
-fx-font-size: 18;
} }
.code-view, .text-area { .code-view, .text-area {
@@ -35,7 +36,7 @@
-fx-text-fill: #ffa235; -fx-text-fill: #ffa235;
} }
.code-stop{ .code-stop {
-fx-font-weight: bold; -fx-font-weight: bold;
-fx-text-fill: #990208; -fx-text-fill: #990208;
} }