| 2068 | } |
| 2069 | |
| 2070 | void Viewport::on_drag_timer() |
| 2071 | { |
| 2072 | const int64_t offset = _view.offset(); |
| 2073 | const double scale = _view.scale(); |
| 2074 | |
| 2075 | if (_view.session().is_stopped_status() |
| 2076 | && _drag_strength != 0 |
| 2077 | && offset < _view.get_max_offset() |
| 2078 | && offset > _view.get_min_offset()) |
| 2079 | { |
| 2080 | _view.set_scale_offset(scale, offset + _drag_strength); |
| 2081 | _drag_strength /= DragDamping; |
| 2082 | if (_drag_strength != 0) |
| 2083 | _drag_timer.start(DragTimerInterval); |
| 2084 | } |
| 2085 | else if (offset == _view.get_max_offset() || |
| 2086 | offset == _view.get_min_offset()) { |
| 2087 | _drag_strength = 0; |
| 2088 | _drag_timer.stop(); |
| 2089 | set_action(NO_ACTION); |
| 2090 | } |
| 2091 | else if (_action_type == NO_ACTION){ |
| 2092 | _drag_strength = 0; |
| 2093 | _drag_timer.stop(); |
| 2094 | } |
| 2095 | } |
| 2096 | |
| 2097 | void Viewport::set_need_update(bool update) |
| 2098 | { |
nothing calls this directly
no test coverage detected