1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-29 07:58:42 +01:00

Bug1155: Fix off-by-one errors in painting of wave or label track backgrounds.

This commit is contained in:
Paul Licameli
2015-08-20 23:02:39 -04:00
parent 9a01c46c69
commit 23facd70c6

View File

@@ -3282,12 +3282,12 @@ void TrackArtist::DrawBackgroundWithSelection(wxDC *dc, const wxRect &rect,
dc->SetBrush(unselBrush); dc->SetBrush(unselBrush);
dc->DrawRectangle(before); dc->DrawRectangle(before);
within.x = before.GetRight(); within.x = 1 + before.GetRight();
} }
within.width = rect.x + int(zoomInfo.TimeToPosition(sel1) + 2) - within.x; within.width = rect.x + int(zoomInfo.TimeToPosition(sel1) + 2) - within.x;
if (within.GetRight() > rect.GetRight()) { if (within.GetRight() > rect.GetRight()) {
within.width = rect.GetRight() - within.x; within.width = 1 + rect.GetRight() - within.x;
} }
if (within.width > 0) { if (within.width > 0) {
@@ -3302,14 +3302,14 @@ void TrackArtist::DrawBackgroundWithSelection(wxDC *dc, const wxRect &rect,
DrawSyncLockTiles(dc, within); DrawSyncLockTiles(dc, within);
} }
after.x = within.GetRight(); after.x = 1 + within.GetRight();
} }
else { else {
// `within` not drawn; start where it would have gone // `within` not drawn; start where it would have gone
after.x = within.x; after.x = within.x;
} }
after.width = rect.GetRight() - after.x; after.width = 1 + rect.GetRight() - after.x;
if (after.width > 0) { if (after.width > 0) {
dc->SetBrush(unselBrush); dc->SetBrush(unselBrush);
dc->DrawRectangle(after); dc->DrawRectangle(after);