mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-12 17:46:34 +01:00
fix rubber band selection coords so that it works in Editor & Pianoroll
This commit is contained in:
parent
e4beb5c3d9
commit
7ec2bc4edd
1 changed files with 10 additions and 2 deletions
|
|
@ -2566,10 +2566,18 @@ MidiView::update_drag_selection(timepos_t const & start, timepos_t const & end,
|
||||||
|
|
||||||
// Convert to local coordinates
|
// Convert to local coordinates
|
||||||
const double y = _midi_context.y_position();
|
const double y = _midi_context.y_position();
|
||||||
const double x0 = _editing_context.sample_to_pixel_unrounded (max<samplepos_t>(0, _midi_region->region_relative_position (start).samples()));
|
|
||||||
const double x1 = _editing_context.sample_to_pixel_unrounded (max<samplepos_t>(0, _midi_region->region_relative_position (end).samples()));
|
|
||||||
const double y0 = max(0.0, gy0 - y);
|
const double y0 = max(0.0, gy0 - y);
|
||||||
const double y1 = max(0.0, gy1 - y);
|
const double y1 = max(0.0, gy1 - y);
|
||||||
|
double x0;
|
||||||
|
double x1;
|
||||||
|
|
||||||
|
if (_midi_region && !_show_source) {
|
||||||
|
x0 = _editing_context.sample_to_pixel_unrounded (max<samplepos_t>(0, _midi_region->region_relative_position (start).samples()));
|
||||||
|
x1 = _editing_context.sample_to_pixel_unrounded (max<samplepos_t>(0, _midi_region->region_relative_position (end).samples()));
|
||||||
|
} else {
|
||||||
|
x0 = _editing_context.sample_to_pixel_unrounded (max<samplepos_t>(0, start.samples()));
|
||||||
|
x1 = _editing_context.sample_to_pixel_unrounded (max<samplepos_t>(0, end.samples()));
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Make this faster by storing the last updated selection rect, and only
|
// TODO: Make this faster by storing the last updated selection rect, and only
|
||||||
// adjusting things that are in the area that appears/disappeared.
|
// adjusting things that are in the area that appears/disappeared.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue