From cd217d6c6ae1c532d8c8e1a53c0ef6bc261fb9a2 Mon Sep 17 00:00:00 2001 From: Bernhard Feichtinger <43303168+BieHDC@users.noreply.github.com> Date: Fri, 28 May 2021 19:22:55 +0200 Subject: [PATCH] Fix wrong scrolling in nk_edit_* when multiline is enabled --- nuklear.h | 3 ++- package.json | 2 +- src/CHANGELOG | 1 + src/nuklear_edit.c | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/nuklear.h b/nuklear.h index 3c19f93..0e039ad 100644 --- a/nuklear.h +++ b/nuklear.h @@ -26855,7 +26855,7 @@ nk_do_edit(nk_flags *state, struct nk_command_buffer *out, /* vertical scroll */ if (cursor_pos.y < edit->scrollbar.y) edit->scrollbar.y = NK_MAX(0.0f, cursor_pos.y - row_height); - if (cursor_pos.y >= edit->scrollbar.y + area.h) + if (cursor_pos.y >= edit->scrollbar.y + row_height) edit->scrollbar.y = edit->scrollbar.y + row_height; } else edit->scrollbar.y = 0; } @@ -29175,6 +29175,7 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args) /// - [yy]: Minor version with non-breaking API and library changes /// - [zz]: Bug fix version with no direct changes to API /// +/// - 2021/08/08 (4.07.2) - Fix Multiline Edit wrong offset /// - 2021/03/17 (4.07.1) - Fix warning about unused parameter /// - 2021/03/17 (4.07.0) - Fix nk_property hover bug /// - 2021/03/15 (4.06.4) - Change nk_propertyi back to int diff --git a/package.json b/package.json index 229cb0b..5abd84a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nuklear", - "version": "4.07.1", + "version": "4.07.2", "repo": "Immediate-Mode-UI/Nuklear", "description": "A small ANSI C gui toolkit", "keywords": ["gl", "ui", "toolkit"], diff --git a/src/CHANGELOG b/src/CHANGELOG index 90e9d74..7f3f87c 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -8,6 +8,7 @@ /// - [yy]: Minor version with non-breaking API and library changes /// - [zz]: Bug fix version with no direct changes to API /// +/// - 2021/08/08 (4.07.2) - Fix Multiline Edit wrong offset /// - 2021/03/17 (4.07.1) - Fix warning about unused parameter /// - 2021/03/17 (4.07.0) - Fix nk_property hover bug /// - 2021/03/15 (4.06.4) - Change nk_propertyi back to int diff --git a/src/nuklear_edit.c b/src/nuklear_edit.c index 1441c61..2c53a6e 100644 --- a/src/nuklear_edit.c +++ b/src/nuklear_edit.c @@ -471,7 +471,7 @@ nk_do_edit(nk_flags *state, struct nk_command_buffer *out, /* vertical scroll */ if (cursor_pos.y < edit->scrollbar.y) edit->scrollbar.y = NK_MAX(0.0f, cursor_pos.y - row_height); - if (cursor_pos.y >= edit->scrollbar.y + area.h) + if (cursor_pos.y >= edit->scrollbar.y + row_height) edit->scrollbar.y = edit->scrollbar.y + row_height; } else edit->scrollbar.y = 0; }