Merge pull request #655 from Artomatix/master

Make text edit scroll less when typing past the end
pull/653/merge
Micha Mettke 2018-04-01 04:12:58 -07:00 committed by GitHub
commit 2825f3492e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -17140,7 +17140,7 @@ nk_do_edit(nk_flags *state, struct nk_command_buffer *out,
if (cursor_pos.x < edit->scrollbar.x)
edit->scrollbar.x = (float)(int)NK_MAX(0.0f, cursor_pos.x - scroll_increment);
if (cursor_pos.x >= edit->scrollbar.x + area.w)
edit->scrollbar.x = (float)(int)NK_MAX(0.0f, cursor_pos.x);
edit->scrollbar.x = (float)(int)NK_MAX(0.0f, edit->scrollbar.x + scroll_increment);
} else edit->scrollbar.x = 0;
if (flags & NK_EDIT_MULTILINE) {