| 640 | } |
| 641 | |
| 642 | void View::update_scale_offset() |
| 643 | { |
| 644 | int width = get_view_width(); |
| 645 | if (width == 0){ |
| 646 | return; |
| 647 | } |
| 648 | |
| 649 | if (_device_agent->get_work_mode() != DSO) { |
| 650 | _maxscale = _session->cur_sampletime() / (width * MaxViewRate); |
| 651 | _minscale = (1.0 / _session->cur_snap_samplerate()) / MaxPixelsPerSample; |
| 652 | } |
| 653 | else { |
| 654 | _scale = _session->cur_view_time() / width; |
| 655 | _maxscale = 1e9; |
| 656 | _minscale = 1e-15; |
| 657 | } |
| 658 | |
| 659 | _scale = max(min(_scale, _maxscale), _minscale); |
| 660 | _offset = max(min(_offset, get_max_offset()), get_min_offset()); |
| 661 | |
| 662 | _preScale = _scale; |
| 663 | _preOffset = _offset; |
| 664 | |
| 665 | _ruler->update(); |
| 666 | viewport_update(); |
| 667 | } |
| 668 | |
| 669 | void View::mode_changed() |
| 670 | { |
nothing calls this directly
no test coverage detected