Move color and x_opt out of Cursor

This commit is contained in:
Jeremy Soller 2023-12-15 15:03:29 -07:00
parent 04d53ac5f4
commit ae030e9885
12 changed files with 645 additions and 546 deletions

View file

@ -15,6 +15,8 @@ fn redraw(
) {
let bg_color = orbclient::Color::rgb(0x34, 0x34, 0x34);
let font_color = Color::rgb(0xFF, 0xFF, 0xFF);
let cursor_color = Color::rgb(0xFF, 0xFF, 0xFF);
let selection_color = Color::rgba(0xFF, 0xFF, 0xFF, 0x33);
editor.shape_as_needed(true);
if editor.buffer().redraw() {
@ -22,9 +24,15 @@ fn redraw(
window.set(bg_color);
editor.draw(swash_cache, font_color, |x, y, w, h, color| {
window.rect(x, y, w, h, orbclient::Color { data: color.0 });
});
editor.draw(
swash_cache,
font_color,
cursor_color,
selection_color,
|x, y, w, h, color| {
window.rect(x, y, w, h, orbclient::Color { data: color.0 });
},
);
window.sync();