mirror of
https://github.com/godotengine/godot.git
synced 2024-11-10 06:03:09 +00:00
Merge pull request #42471 from xsellier/patch-3
[2.1] Fixes for cursor handling in RichTextLabel
This commit is contained in:
commit
89e531d223
@ -722,20 +722,21 @@ void RichTextLabel::_find_click(ItemFrame *p_frame, const Point2i &p_click, Item
|
||||
Control::CursorShape RichTextLabel::get_cursor_shape(const Point2 &p_pos) const {
|
||||
|
||||
if (!underline_meta || selection.click)
|
||||
return CURSOR_ARROW;
|
||||
return get_default_cursor_shape();
|
||||
|
||||
if (main->first_invalid_line < main->lines.size())
|
||||
return CURSOR_ARROW; //invalid
|
||||
return get_default_cursor_shape(); //invalid
|
||||
|
||||
int line = 0;
|
||||
bool outside;
|
||||
Item *item = NULL;
|
||||
|
||||
((RichTextLabel *)(this))->_find_click(main, p_pos, &item, &line);
|
||||
((RichTextLabel *)(this))->_find_click(main, p_pos, &item, &line, &outside);
|
||||
|
||||
if (item && ((RichTextLabel *)(this))->_find_meta(item, NULL))
|
||||
if (item && !outside && ((RichTextLabel *)(this))->_find_meta(item, NULL))
|
||||
return CURSOR_POINTING_HAND;
|
||||
|
||||
return CURSOR_ARROW;
|
||||
return get_default_cursor_shape();
|
||||
}
|
||||
|
||||
void RichTextLabel::_input_event(InputEvent p_event) {
|
||||
|
Loading…
Reference in New Issue
Block a user