MCPcopy Create free account
hub / github.com/KLayout/klayout / mouse_move_event

Method mouse_move_event

src/laybasic/laybasic/layZoomBox.cc:65–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65bool
66ZoomService::mouse_move_event (const db::DPoint &p, unsigned int /*buttons*/, bool prio)
67{
68 if (prio) {
69
70 if (mp_box) {
71
72 m_p2 = p;
73 mp_box->set_points (m_p1, m_p2);
74
75 mp_view->message ("w: " + tl::micron_to_string (fabs (m_p2.x () - m_p1.x ())) + " h: " + tl::micron_to_string (fabs (m_p2.y () - m_p1.y ())));
76
77 } else if (mp_view) {
78
79 m_vp.move (m_p1 - p);
80 mp_view->pop_state (); // we will overwrite the previous state so we don't collect tiny move events
81 mp_view->zoom_box (m_vp);
82
83 }
84
85 return true;
86
87 } else {
88 return false;
89 }
90}
91
92bool
93ZoomService::mouse_press_event (const db::DPoint &p, unsigned int buttons, bool prio)

Callers

nothing calls this directly

Calls 8

micron_to_stringFunction · 0.85
yMethod · 0.80
set_pointsMethod · 0.45
messageMethod · 0.45
xMethod · 0.45
moveMethod · 0.45
pop_stateMethod · 0.45
zoom_boxMethod · 0.45

Tested by

no test coverage detected