Invert parameters.

This commit is contained in:
Nolan Darilek 2021-05-19 10:53:15 -05:00
parent 68499cebf6
commit 4fa1e82129
2 changed files with 2 additions and 2 deletions

View file

@ -344,7 +344,7 @@ impl WidgetInfo {
}
#[allow(clippy::needless_pass_by_value)]
pub fn text_edit(text_value: impl ToString, prev_text_value: impl ToString) -> Self {
pub fn text_edit(prev_text_value: impl ToString, text_value: impl ToString) -> Self {
Self {
current_text_value: Some(text_value.to_string()),
prev_text_value: Some(prev_text_value.to_string()),

View file

@ -661,7 +661,7 @@ impl<'t> TextEdit<'t> {
ui.memory().id_data.insert(id, state);
if response.changed {
response.widget_info(|| WidgetInfo::text_edit(&*text, &*prev_text));
response.widget_info(|| WidgetInfo::text_edit(&*prev_text, &*text));
} else if let Some(text_cursor) = text_cursor {
let char_range =
text_cursor.primary.ccursor.index..=text_cursor.secondary.ccursor.index;