Skip to content

Commit 2abf0c3

Browse files
committed
Cleanup some cruft
1 parent cebfa03 commit 2abf0c3

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

src/app.rs

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,14 @@ impl eframe::App for TemplateApp {
106106
// dunno where this is placed, which coordinate system this uses etc.
107107
// But when combined with sensing a drag_and_drop this SHOULD provide me with enough info to find
108108
// the gauss center (if any) that drags correspond to.
109-
let start_loc =
110-
ui.input(|input_state| input_state.pointer.press_origin());
111-
112-
let start_loc2 =
113-
ui.input(|input_state| input_state.pointer.interact_pos());
109+
let (start_loc, current_loc) =
110+
ui.input(|input_state| (input_state.pointer.press_origin(), input_state.pointer.interact_pos()));
114111

115112
// this doesnt seem to hold to what the documentation promises.
116113
// documentation promises this is the delta for each frame, but it behaves as I'd expect if it were the total delta.
117114
// let frame_delta = ui.input(|input_state| input_state.pointer.delta());
118115
// cc.egui_ctx.wants_pointer_input()
119116

120-
let painter = ui.painter();
121117
// let delta = if _response.dragged() {
122118
// // _response.drag_delta()
123119
// canvas_coord_to_ndc(frame_delta.to_pos2(), rect).to_vec2()
@@ -131,7 +127,7 @@ impl eframe::App for TemplateApp {
131127
if _response.dragged() {
132128
ele.position = canvas_coord_to_ndc(
133129
Pos2::from(ele.position)
134-
+ (start_loc2.unwrap().to_vec2()
130+
+ (current_loc.unwrap().to_vec2()
135131
- start_loc.unwrap().to_vec2()),
136132
rect,
137133
)
@@ -144,19 +140,6 @@ impl eframe::App for TemplateApp {
144140
egui::Color32::RED,
145141
);
146142
}
147-
148-
// response.
149-
150-
// do dragndrop with the centers of the gaussians aka
151-
// (this is ironically from the wgpu render demo, I originally stripped it out):
152-
// let (rect, response) =
153-
// ui.allocate_exact_size(egui::Vec2::splat(300.0), egui::Sense::drag());
154-
155-
// self.angle += response.drag_motion().x * 0.01;
156-
// ui.painter().add(egui_wgpu::Callback::new_paint_callback(
157-
// rect,
158-
// CustomTriangleCallback { angle: self.angle },
159-
// ));
160143
}
161144
});
162145
});

0 commit comments

Comments
 (0)