Merge pull request #137 from lundril/scrollfix2
fix nk_do_edit: Keep scroll position when re-activating edit widget.
This commit is contained in:
commit
bffe1037b2
|
@ -26535,7 +26535,10 @@ nk_do_edit(nk_flags *state, struct nk_command_buffer *out,
|
||||||
if (!prev_state && edit->active) {
|
if (!prev_state && edit->active) {
|
||||||
const enum nk_text_edit_type type = (flags & NK_EDIT_MULTILINE) ?
|
const enum nk_text_edit_type type = (flags & NK_EDIT_MULTILINE) ?
|
||||||
NK_TEXT_EDIT_MULTI_LINE: NK_TEXT_EDIT_SINGLE_LINE;
|
NK_TEXT_EDIT_MULTI_LINE: NK_TEXT_EDIT_SINGLE_LINE;
|
||||||
|
/* keep scroll position when re-activating edit widget */
|
||||||
|
struct nk_vec2 oldscrollbar = edit->scrollbar;
|
||||||
nk_textedit_clear_state(edit, type, filter);
|
nk_textedit_clear_state(edit, type, filter);
|
||||||
|
edit->scrollbar = oldscrollbar;
|
||||||
if (flags & NK_EDIT_AUTO_SELECT)
|
if (flags & NK_EDIT_AUTO_SELECT)
|
||||||
select_all = nk_true;
|
select_all = nk_true;
|
||||||
if (flags & NK_EDIT_GOTO_END_ON_ACTIVATE) {
|
if (flags & NK_EDIT_GOTO_END_ON_ACTIVATE) {
|
||||||
|
@ -29094,6 +29097,7 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args)
|
||||||
/// - [yy]: Minor version with non-breaking API and library changes
|
/// - [yy]: Minor version with non-breaking API and library changes
|
||||||
/// - [zz]: Bug fix version with no direct changes to API
|
/// - [zz]: Bug fix version with no direct changes to API
|
||||||
///
|
///
|
||||||
|
/// - 2020/05/27 (4.02.5) - Fix nk_do_edit: Keep scroll position when re-activating edit widget.
|
||||||
/// - 2020/05/09 (4.02.4) - Fix nk_menubar height calculation bug
|
/// - 2020/05/09 (4.02.4) - Fix nk_menubar height calculation bug
|
||||||
/// - 2020/05/08 (4.02.3) - Fix missing stdarg.h with NK_INCLUDE_STANDARD_VARARGS
|
/// - 2020/05/08 (4.02.3) - Fix missing stdarg.h with NK_INCLUDE_STANDARD_VARARGS
|
||||||
/// - 2020/04/30 (4.02.2) - Fix nk_edit border drawing bug
|
/// - 2020/04/30 (4.02.2) - Fix nk_edit border drawing bug
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "nuklear",
|
"name": "nuklear",
|
||||||
"version": "4.02.4",
|
"version": "4.02.5",
|
||||||
"repo": "Immediate-Mode-UI/Nuklear",
|
"repo": "Immediate-Mode-UI/Nuklear",
|
||||||
"description": "A small ANSI C gui toolkit",
|
"description": "A small ANSI C gui toolkit",
|
||||||
"keywords": ["gl", "ui", "toolkit"],
|
"keywords": ["gl", "ui", "toolkit"],
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
/// - [yy]: Minor version with non-breaking API and library changes
|
/// - [yy]: Minor version with non-breaking API and library changes
|
||||||
/// - [zz]: Bug fix version with no direct changes to API
|
/// - [zz]: Bug fix version with no direct changes to API
|
||||||
///
|
///
|
||||||
|
/// - 2020/05/27 (4.02.5) - Fix nk_do_edit: Keep scroll position when re-activating edit widget.
|
||||||
/// - 2020/05/09 (4.02.4) - Fix nk_menubar height calculation bug
|
/// - 2020/05/09 (4.02.4) - Fix nk_menubar height calculation bug
|
||||||
/// - 2020/05/08 (4.02.3) - Fix missing stdarg.h with NK_INCLUDE_STANDARD_VARARGS
|
/// - 2020/05/08 (4.02.3) - Fix missing stdarg.h with NK_INCLUDE_STANDARD_VARARGS
|
||||||
/// - 2020/04/30 (4.02.2) - Fix nk_edit border drawing bug
|
/// - 2020/04/30 (4.02.2) - Fix nk_edit border drawing bug
|
||||||
|
|
|
@ -195,7 +195,10 @@ nk_do_edit(nk_flags *state, struct nk_command_buffer *out,
|
||||||
if (!prev_state && edit->active) {
|
if (!prev_state && edit->active) {
|
||||||
const enum nk_text_edit_type type = (flags & NK_EDIT_MULTILINE) ?
|
const enum nk_text_edit_type type = (flags & NK_EDIT_MULTILINE) ?
|
||||||
NK_TEXT_EDIT_MULTI_LINE: NK_TEXT_EDIT_SINGLE_LINE;
|
NK_TEXT_EDIT_MULTI_LINE: NK_TEXT_EDIT_SINGLE_LINE;
|
||||||
|
/* keep scroll position when re-activating edit widget */
|
||||||
|
struct nk_vec2 oldscrollbar = edit->scrollbar;
|
||||||
nk_textedit_clear_state(edit, type, filter);
|
nk_textedit_clear_state(edit, type, filter);
|
||||||
|
edit->scrollbar = oldscrollbar;
|
||||||
if (flags & NK_EDIT_AUTO_SELECT)
|
if (flags & NK_EDIT_AUTO_SELECT)
|
||||||
select_all = nk_true;
|
select_all = nk_true;
|
||||||
if (flags & NK_EDIT_GOTO_END_ON_ACTIVATE) {
|
if (flags & NK_EDIT_GOTO_END_ON_ACTIVATE) {
|
||||||
|
|
Loading…
Reference in New Issue