MCPcopy Create free account
hub / github.com/angular-rust/ux-components / mousemove

Method mousemove

src/services/focus.rs:188–238  ·  view source on GitHub ↗
(&self, e: &mut MouseEvent)

Source from the content-addressed store, hash-verified

186 }
187
188 fn mousemove(&self, e: &mut MouseEvent) {
189 let handled = match self.canvas.captured() {
190 Some(captured) => {
191 if captured.mouse_input() {
192 if let Some(markable) =
193 self.get_markable(captured.as_ref(), e.x as f32, e.y as f32)
194 {
195 self.mark_control(markable, e);
196 }
197
198 if self.marked_mouse() {
199 if let Some(marked) = self.canvas.marked() {
200 marked.mousemove(e);
201 }
202 }
203 true
204 } else {
205 false
206 }
207 }
208 None => false,
209 };
210
211 let component = self.canvas.component.borrow();
212 if !handled && component.ishovered {
213 //if the mouse has left the current marked control, unmark
214 if let Some(marked) = self.canvas.marked() {
215 if !marked.contains(e.x as f32, e.y as f32) {
216 self.unmark_control(marked.as_ref(), e);
217 }
218 }
219
220 // the focused control always gets the events
221 if let Some(focused) = self.canvas.focused() {
222 if focused.mouse_input() {
223 focused.mousemove(e);
224 }
225 }
226
227 //get the marked control from the canvas
228 if let Some(markable) = self.get_markable(&self.canvas, e.x as f32, e.y as f32) {
229 self.mark_control(markable, e);
230 }
231
232 if self.marked_mouse() {
233 if let Some(marked) = self.canvas.marked() {
234 marked.mousemove(e);
235 }
236 }
237 }
238 }
239
240 fn reset_marked(&self, control: &dyn Element, e: &mut MouseEvent) {
241 if control.is_marked() {

Callers

nothing calls this directly

Calls 10

get_markableMethod · 0.80
mark_controlMethod · 0.80
marked_mouseMethod · 0.80
unmark_controlMethod · 0.80
capturedMethod · 0.45
mouse_inputMethod · 0.45
as_refMethod · 0.45
markedMethod · 0.45
containsMethod · 0.45
focusedMethod · 0.45

Tested by

no test coverage detected