MCPcopy Index your code
hub / github.com/DreamSourceLab/DSView / zoom

Method zoom

DSView/pv/view/spectrumtrace.cpp:151–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151void SpectrumTrace::zoom(double steps, int offset)
152{
153 if (!_view)
154 return;
155
156 const int width = get_view_rect().width();
157 double pre_offset = _offset + _scale*offset/width;
158 _scale *= std::pow(3.0/2.0, -steps);
159 _scale = max(min(_scale, 1.0), 100.0/_spectrum_stack->get_sample_num());
160 _offset = pre_offset - _scale*offset/width;
161 _offset = max(min(_offset, 1-_scale), 0.0);
162
163 _view->set_update(_viewport, true);
164 _view->update();
165}
166
167void SpectrumTrace::set_offset(double delta)
168{

Callers

nothing calls this directly

Calls 3

set_updateMethod · 0.80
get_sample_numMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected