mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 22:30:03 -04:00
Invert parameters.
This commit is contained in:
@@ -344,7 +344,7 @@ impl WidgetInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::needless_pass_by_value)]
|
#[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 {
|
Self {
|
||||||
current_text_value: Some(text_value.to_string()),
|
current_text_value: Some(text_value.to_string()),
|
||||||
prev_text_value: Some(prev_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);
|
ui.memory().id_data.insert(id, state);
|
||||||
|
|
||||||
if response.changed {
|
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 {
|
} else if let Some(text_cursor) = text_cursor {
|
||||||
let char_range =
|
let char_range =
|
||||||
text_cursor.primary.ccursor.index..=text_cursor.secondary.ccursor.index;
|
text_cursor.primary.ccursor.index..=text_cursor.secondary.ccursor.index;
|
||||||
|
|||||||
Reference in New Issue
Block a user