Add code components 366-385; ScrollArea Follow, editor sync
A terminal with history, a Go-colored code block, a log viewer that follows, a hex viewer, a memory map, a JSON tree, a line diff, a GAME OVER crash screen, an FPS meter, profiler bars, breakpoints, variables, command history, a shortcut list, a debug grid, a pixel editor that exports string art, a palette editor, a sprite sheet, a glyph map and a 6502 register view. layout.ScrollArea takes Follow, and ChatLog now uses it. data.TreeNode takes a Value drawn in its Slot. pixel gains Has, and Sprite.Art writes MustSprite art. pixel.Editor takes the caller's value at each input event, so a value changed between frames is never typed onto.
This commit is contained in:
42 files changed
+3415
-37
No files matched your search
@@ -81,6 +81,10 @@ func Editor(c *ui.Context, value *string, o EditorOptions) Edit {
|
||||
composing := cb > ca
|
||||
base.TextCaret(ui.Rect{X: k.D(cx - scroll), Y: k.D(cl * LineHeight), W: k.dot, H: k.D(LineHeight)})
|
||||
base.HandleInput(func(ev ui.InputEvent) bool {
|
||||
// The caller may have changed the value since this frame.
|
||||
if string(s.text) != *value {
|
||||
s.reset(*value)
|
||||
}
|
||||
took := s.handle(ev, env)
|
||||
if s.changed {
|
||||
*value = string(s.text)
|
||||
|
||||
Reference in new issue
Block a user