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:
vurtun 2016-06-15 14:10:32 +02:00
parent 4d8738282a
commit e7307ae2fd
1 changed files with 2 additions and 4 deletions

View File

@ -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;