Skip to content

Commit

Permalink
karm-text: Fixed editor caret rendering.
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepy-monax committed Nov 3, 2024
1 parent 6be9eb2 commit 28dc393
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/apps/hideo-text/res/lorem.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Eius cupiditate quas natus voluptatibus ipsa! Tenetur, ipsa
magnam labore, aut quis assumenda vitae debitis corrupti repellendus aspernatur similique facilis! Reprehenderit, nihil?
2 changes: 2 additions & 0 deletions src/libs/karm-text/prose.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,11 @@ struct Prose {
auto cs = baseline - Math::Vec2f{0, m.ascend};
auto ce = baseline + Math::Vec2f{0, m.descend};

g.beginPath();
g.moveTo(cs);
g.lineTo(ce);
g.strokeStyle(Gfx::stroke(color).withAlign(Gfx::CENTER_ALIGN).withWidth(2));
g.stroke();
}

struct Lbc {
Expand Down
2 changes: 1 addition & 1 deletion src/libs/karm-ui/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ struct Input : public View<Input> {

auto &text = _ensureText();

text.paintCaret(g, _model->_cur.head, Ui::ACCENT500);
text.paintCaret(g, _model->_cur.head, _style.color.unwrapOr(Ui::GRAY100));
text.paint(g);

g.pop();
Expand Down

0 comments on commit 28dc393

Please sign in to comment.