Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Graphics
Gwenview
Commits
29d09bef
Commit
29d09bef
authored
Mar 18, 2021
by
Arjen Hiemstra
Browse files
Prefer generating thumbnails for things that are even slightly visible
Otherwise we may end up with things not showing up at all
parent
ea22bed7
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/thumbnailview/thumbnailview.cpp
View file @
29d09bef
...
...
@@ -920,13 +920,7 @@ void ThumbnailView::generateThumbnailsForItems()
// Compute distance
int
distance
;
const
QRect
itemRect
=
visualRect
(
index
);
const
qreal
itemSurface
=
itemRect
.
width
()
*
itemRect
.
height
();
const
QRect
visibleItemRect
=
visibleRect
.
intersected
(
itemRect
);
qreal
visibleItemFract
=
0
;
if
(
itemSurface
>
0
)
{
visibleItemFract
=
visibleItemRect
.
width
()
*
visibleItemRect
.
height
()
/
itemSurface
;
}
if
(
visibleItemFract
>
0.7
)
{
if
(
itemRect
.
isValid
())
{
// Item is visible, order thumbnails from left to right, top to bottom
// Distance is computed so that it is between 0 and visibleSurface
distance
=
itemRect
.
top
()
*
visibleRect
.
width
()
+
itemRect
.
left
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment