13
0

Fix crash when clicking on region boundary box to start Drag

The box outlines a given region, the grab position may be earlier
than the region's position.

Previously this caused a crash (uncaught exception):

```gdb
__cxa_throw () at /lib/x86_64-linux-gnu/libstdc++.so.6
Temporal::timecnt_t::timecnt_t(Temporal::timecnt_t const&, Temporal::timepos_t const&) at ../libs/temporal/timeline.cc:79
RegionMoveDrag::setup_pointer_offset() at ../gtk2_ardour/editor_drag.cc:2226
```
This commit is contained in:
Robin Gareus 2023-11-21 20:17:20 +01:00
parent f01f4eeded
commit 71e049202c
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -2223,7 +2223,7 @@ RegionMoveDrag::RegionMoveDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p,
void
RegionMoveDrag::setup_pointer_offset ()
{
_pointer_offset = timecnt_t (_last_position.distance (raw_grab_time ()), _last_position);
_pointer_offset = _last_position.distance (raw_grab_time ());
}
RegionInsertDrag::RegionInsertDrag (Editor* e, std::shared_ptr<Region> r, RouteTimeAxisView* v, timepos_t const& pos, Temporal::TimeDomain td)