You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Fix TextServer::shaped_text_*_character_pos for the first character of wrapped string. Allow starting/ending RTL selection before line start.
(cherry picked from commit 932acce8f2)
This commit is contained in:
@@ -1563,7 +1563,7 @@ int64_t TextServer::shaped_text_prev_grapheme_pos(const RID &p_shaped, int64_t p
|
||||
|
||||
int64_t TextServer::shaped_text_prev_character_pos(const RID &p_shaped, int64_t p_pos) const {
|
||||
const PackedInt32Array &chars = shaped_text_get_character_breaks(p_shaped);
|
||||
int64_t prev = 0;
|
||||
int64_t prev = shaped_text_get_range(p_shaped).x;
|
||||
for (const int32_t &E : chars) {
|
||||
if (E >= p_pos) {
|
||||
return prev;
|
||||
@@ -1575,7 +1575,7 @@ int64_t TextServer::shaped_text_prev_character_pos(const RID &p_shaped, int64_t
|
||||
|
||||
int64_t TextServer::shaped_text_next_character_pos(const RID &p_shaped, int64_t p_pos) const {
|
||||
const PackedInt32Array &chars = shaped_text_get_character_breaks(p_shaped);
|
||||
int64_t prev = 0;
|
||||
int64_t prev = shaped_text_get_range(p_shaped).x;
|
||||
for (const int32_t &E : chars) {
|
||||
if (E > p_pos) {
|
||||
return E;
|
||||
@@ -1587,7 +1587,7 @@ int64_t TextServer::shaped_text_next_character_pos(const RID &p_shaped, int64_t
|
||||
|
||||
int64_t TextServer::shaped_text_closest_character_pos(const RID &p_shaped, int64_t p_pos) const {
|
||||
const PackedInt32Array &chars = shaped_text_get_character_breaks(p_shaped);
|
||||
int64_t prev = 0;
|
||||
int64_t prev = shaped_text_get_range(p_shaped).x;
|
||||
for (const int32_t &E : chars) {
|
||||
if (E == p_pos) {
|
||||
return E;
|
||||
|
||||
Reference in New Issue
Block a user