From 154e20d59259daa9047ca175e4d909c4e225da86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Pastuszak?= Date: Wed, 3 Aug 2016 12:48:37 +0200 Subject: [PATCH] Fix setCursorAtTextEnd typo --- ui/CHANGES.md | 1 + ui/src/main/java/com/kotcrab/vis/ui/widget/VisTextField.java | 4 +++- .../vis/ui/widget/file/internal/FileSuggestionPopup.java | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/CHANGES.md b/ui/CHANGES.md index 2e605dd62..74670d941 100644 --- a/ui/CHANGES.md +++ b/ui/CHANGES.md @@ -1,4 +1,5 @@ #### Version: 1.1.5-SNAPSHOT (LibGDX 1.9.3) +- **API Changed**: `VisTextField#setCurosrAtTextEnd` renamed to `setCursorAtTextEnd` (typo) - **Added**: `Tooltip#getTarget` - **Added**: `MenuItem` constructors taking style name - **Changed**: It's now impossible to create `FileTypeFilter` `Rule` without providing at least one extension diff --git a/ui/src/main/java/com/kotcrab/vis/ui/widget/VisTextField.java b/ui/src/main/java/com/kotcrab/vis/ui/widget/VisTextField.java index 45adfb2b3..cd1f281fe 100644 --- a/ui/src/main/java/com/kotcrab/vis/ui/widget/VisTextField.java +++ b/ui/src/main/java/com/kotcrab/vis/ui/widget/VisTextField.java @@ -766,7 +766,9 @@ public int getCursorPosition () { return cursor; } - public void setCurosrAtTextEnd () { + public void setCursorAtTextEnd () { + setCursorPosition(0); + calculateOffsets(); setCursorPosition(getText().length()); } diff --git a/ui/src/main/java/com/kotcrab/vis/ui/widget/file/internal/FileSuggestionPopup.java b/ui/src/main/java/com/kotcrab/vis/ui/widget/file/internal/FileSuggestionPopup.java index fa965fdf7..51362c4c6 100644 --- a/ui/src/main/java/com/kotcrab/vis/ui/widget/file/internal/FileSuggestionPopup.java +++ b/ui/src/main/java/com/kotcrab/vis/ui/widget/file/internal/FileSuggestionPopup.java @@ -79,7 +79,7 @@ public void changed (ChangeEvent event, Actor actor) { @Override public void changed (ChangeEvent event, Actor actor) { fileNameField.setText(arbitraryPath); - fileNameField.setCurosrAtTextEnd(); + fileNameField.setCursorAtTextEnd(); } }); addItem(item);