From 53a5f5d8ca8da56c8e72b01eceadc47a9eb1783a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 3 Jul 2014 10:00:12 -0400 Subject: [PATCH] actually do something in WaveView::region_resized() which is called whenever the region is resized; implement WaveView::set_region_start() which could be used by an xfade editor etc. --- libs/canvas/wave_view.cc | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/libs/canvas/wave_view.cc b/libs/canvas/wave_view.cc index 6c0cc50494..225010ed4d 100644 --- a/libs/canvas/wave_view.cc +++ b/libs/canvas/wave_view.cc @@ -920,23 +920,35 @@ WaveView::set_global_logscaled (bool yn) } void -WaveView::region_resized () +WaveView::set_region_start (frameoffset_t start) { if (!_region) { return; } - /* special: do not use _region->length() here to compute - bounding box because it will already have changed. - - if we have a bounding box, use it. + if (_region_start == start) { + return; + } + + begin_change (); + _region_start = start; + _bounding_box_dirty = true; + end_change (); +} + +void +WaveView::region_resized () +{ + /* Called when the region start or end (thus length) has changed. */ - _pre_change_bounding_box = _bounding_box; + if (!_region) { + return; + } + begin_change (); + _region_start = _region->start(); _bounding_box_dirty = true; - compute_bounding_box (); - end_change (); }