Fixed text clipping bug inside draw list
Text was previously wrongfully software clipped if text was only partially visible. The wrong behavior is now fixed and text should be clipped only if the text is completely outside the clipping rect.
This commit is contained in:
parent
4d8738282a
commit
e7307ae2fd
|
@ -6402,10 +6402,8 @@ nk_draw_list_add_text(struct nk_draw_list *list, const struct nk_user_font *font
|
|||
|
||||
NK_ASSERT(list);
|
||||
if (!list || !len || !text) return;
|
||||
if (rect.x > (list->clip_rect.x + list->clip_rect.w) ||
|
||||
rect.y > (list->clip_rect.y + list->clip_rect.h) ||
|
||||
rect.x < list->clip_rect.x || rect.y < list->clip_rect.y)
|
||||
return;
|
||||
if (!NK_INTERSECT(rect.x, rect.y, rect.w, rect.h,
|
||||
list->clip_rect.x, list->clip_rect.y, list->clip_rect.w, list->clip_rect.h)) return;
|
||||
|
||||
nk_draw_list_push_image(list, font->texture);
|
||||
x = rect.x;
|
||||
|
|
Loading…
Reference in New Issue