Conversation
fix: smaller text input selection radius for more sane look
|
Does the text layout provide any other information that we should be using to better position the selection? just inflating the rect feels like a solution that will cause as many problems as it solves |
|
Hmm, this also seems to work: let selection_rect = self
.get_selection_rect(&node_layout, padding_left + 1.)
.to_rounded_rect(border_radius);
cx.save();
// cx.clip(&self.id
// .get_size()
// .unwrap_or(Size::new(selection_rect.width(), selection_rect.height()))
// .to_rect()
// );
cx.fill(&selection_rect, &cursor_color, 0.0);
cx.restore();Clip does appear to do nothing here though.. 🤔 |
|
It makes sense to have the clip in case there are rounded corners or some case where it would clip. I think we do want to actually fix this properly using info from the TextLayout |
|
Copy that, but I don't feel competent enough to do that, have looked briefly there and have no idea what is going on :D One note on the side; this change affects only |
|
I think it used to have an inflate on it and I removed it some time ago because it was causing problems |
f550fa2 to
916c8a5
Compare
This PR is adjusting text input selection paint size to cover better selected text and avoid clipping left edge of the selection:
Examples