From 71e049202c017c0a546f39b455bdc9e4be182f06 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 21 Nov 2023 20:17:20 +0100 Subject: [PATCH] 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 ``` --- gtk2_ardour/editor_drag.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 2cc44d93ee..008f89989f 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -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 r, RouteTimeAxisView* v, timepos_t const& pos, Temporal::TimeDomain td)