We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@emilk
#4014 Even after update, the result is still the same. Try running the example below. In 'if clicked()' the value is 0.0.
Reference :
When I checked again, clicked() also seems to work well. However, May be it seems that the value has already disappeared in if clicked().
if clicked()
use eframe::egui::*; fn main() -> Result<(), eframe::Error> { let options = eframe::NativeOptions { viewport: egui::ViewportBuilder::default().with_inner_size([320.0, 240.0]), ..Default::default() }; eframe::run_simple_native("My egui App", options, move |ctx, _frame| { egui::CentralPanel::default().show(ctx, |ui| { ui.heading("My egui Application"); let (response, _painter) = ui.allocate_painter(vec2(300.0, 150.0), Sense::click()); let clicked_pos = response.interact_pointer_pos(); if response.clicked() { let text = format!("clicked_pos: {:?}", clicked_pos.unwrap_or(pos2(0.0, 0.0))); ui.label(RichText::new(text.clone()).color(Color32::LIGHT_RED)); ui.label(RichText::new(text.clone()).color(Color32::LIGHT_RED)); ui.label(RichText::new(text.clone()).color(Color32::LIGHT_RED)); } if response.is_pointer_button_down_on() { let text = format!("down_pos: {:?}", clicked_pos.unwrap_or(pos2(0.0, 0.0))); ui.label(text); } // let clicked_pos = response.interact_pointer_pos(); // let text = format!("clicked_pos: {:?}", clicked_pos.unwrap_or(pos2(0.0, 0.0))); // ui.label(text); }); }) }
The text was updated successfully, but these errors were encountered:
I tested this:
let (response, painter) = ui.allocate_painter(egui::vec2(300.0, 150.0), egui::Sense::click()); painter.rect_filled(response.rect, 2.0, egui::Color32::BLACK); let clicked_pos = response.interact_pointer_pos(); if response.clicked() { eprintln!("clicked_pos: {clicked_pos:?}"); } if response.is_pointer_button_down_on() { eprintln!("down_pos: {clicked_pos:?}"); }
and it works as expected on main
Sorry, something went wrong.
Faced this in 2.6.0, can confirm it work as expected on 2.6.2
No branches or pull requests
@emilk
#4014 Even after update, the result is still the same. Try running the example below. In 'if clicked()' the value is 0.0.
Reference :
When I checked again, clicked() also seems to work well.
However, May be it seems that the value has already disappeared in
if clicked()
.The text was updated successfully, but these errors were encountered: