mirror of
https://github.com/emilk/egui.git
synced 2026-06-27 23:13:13 -04:00
Invert parameters.
This commit is contained in:
@@ -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()),
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user