Make selection area and cursor more visible
This commit is contained in:
parent
99983daa65
commit
2fb56bc5c5
1 changed files with 2 additions and 2 deletions
|
|
@ -1110,13 +1110,13 @@ void TextBox::paint(SkCanvas* canvas, const PaintOpts& paintOpts) {
|
||||||
auto& cur = paintOpts.cursor.value();
|
auto& cur = paintOpts.cursor.value();
|
||||||
SkPaint selectionP{SkColor4f{paintOpts.cursorColor.x(), paintOpts.cursorColor.y(), paintOpts.cursorColor.z(), 1.0f}};
|
SkPaint selectionP{SkColor4f{paintOpts.cursorColor.x(), paintOpts.cursorColor.y(), paintOpts.cursorColor.z(), 1.0f}};
|
||||||
if(cur.selectionBeginPos != cur.selectionEndPos) {
|
if(cur.selectionBeginPos != cur.selectionEndPos) {
|
||||||
canvas->saveLayerAlphaf(nullptr, 0.3f);
|
canvas->saveLayerAlphaf(nullptr, 0.5f);
|
||||||
rects_between_text_positions_func(cur.selectionBeginPos, cur.selectionEndPos, [&](const SkRect& rect) {
|
rects_between_text_positions_func(cur.selectionBeginPos, cur.selectionEndPos, [&](const SkRect& rect) {
|
||||||
canvas->drawRect(rect, selectionP);
|
canvas->drawRect(rect, selectionP);
|
||||||
});
|
});
|
||||||
canvas->restore();
|
canvas->restore();
|
||||||
}
|
}
|
||||||
SkPaint cursorP{SkColor4f{paintOpts.cursorColor.x(), paintOpts.cursorColor.y(), paintOpts.cursorColor.z(), 0.8f}};
|
SkPaint cursorP{SkColor4f{paintOpts.cursorColor.x(), paintOpts.cursorColor.y(), paintOpts.cursorColor.z(), 1.0f}};
|
||||||
canvas->drawRect(get_cursor_rect(cur.pos), cursorP);
|
canvas->drawRect(get_cursor_rect(cur.pos), cursorP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue