Skip to content

Commit 960cfbf

Browse files
cocoaui: fix album art drawing regression in pinned group mode, regression from 654803f (fixes #3263)
1 parent adf8504 commit 960cfbf

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

plugins/cocoaui/Playlist/PlaylistContentView.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ - (void)drawListView:(NSRect)dirtyRect {
461461

462462
// draw album art
463463
int grp_next_y = grp_y + grp->height;
464-
[self renderAlbumArtForGroup:grp groupIndex:groupIndex isPinnedGroup:(self.pinnedGroupTitleView.group == grp) nextGroupCoord:grp_next_y yPos:grp_y + title_height viewportY:dirtyRect.origin.y clipRegion:dirtyRect];
464+
[self renderAlbumArtForGroup:grp groupIndex:groupIndex isPinnedGroup:(self.pinnedGroupTitleView.group == grp) nextGroupCoord:grp_next_y yPos:grp_y + title_height viewportY:self.enclosingScrollView.documentVisibleRect.origin.y clipRegion:dirtyRect];
465465

466466
idx += grp->num_items;
467467
grp_y += grp->height;

plugins/cocoaui/Playlist/PlaylistViewController.m

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,24 +1012,22 @@ - (void)drawAlbumArtForGroup:(PlaylistGroup *)grp
10121012
[lv.contentView drawGroup:grp];
10131013
}];
10141014
}
1015-
if (!image) {
1015+
if (image == nil) {
10161016
// FIXME: the problem here is that if the cover is not found (yet) -- it won't draw anything, but the rect is already invalidated, and will come out as background color
10171017
return;
10181018
}
10191019

10201020
NSRect drawRect;
10211021

1022-
int art_x = x + ART_PADDING_HORZ;
1023-
CGFloat min_y = (pinned ? viewportY+lv.contentView.grouptitle_height : y) + ART_PADDING_VERT;
1024-
CGFloat max_y = grp_next_y;
1025-
10261022
NSSize size = image.size;
10271023
NSSize desiredSize = [CoverManager.shared desiredSizeForImageSize:size availableSize:availableSize];
10281024
CGSize drawSize = [self.view convertSizeFromBacking:desiredSize];
10291025

1030-
CGFloat ypos = min_y;
1031-
if (min_y + drawSize.height + ART_PADDING_VERT >= max_y) {
1032-
ypos = max_y - drawSize.height - ART_PADDING_VERT;
1026+
CGFloat art_x = x + ART_PADDING_HORZ;
1027+
CGFloat ypos = (pinned ? viewportY + lv.contentView.grouptitle_height : y) + ART_PADDING_VERT;
1028+
1029+
if (pinned && ypos + drawSize.height + ART_PADDING_VERT >= grp_next_y) {
1030+
ypos = grp_next_y - drawSize.height - ART_PADDING_VERT;
10331031
}
10341032

10351033
if (size.width < size.height) {

0 commit comments

Comments
 (0)