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
Office
Calligra
Commits
432cbe53
Commit
432cbe53
authored
Dec 19, 2013
by
Halla Rempt
Browse files
Smoothscale the thumbnail for .kra files
BUG:328767
parent
31d2a71e
Changes
1
Hide whitespace changes
Inline
Side-by-side
krita/ui/kis_doc2.cc
View file @
432cbe53
...
...
@@ -439,10 +439,18 @@ void KisDoc2::paintContent(QPainter& painter, const QRect& rc)
QPixmap
KisDoc2
::
generatePreview
(
const
QSize
&
size
)
{
if
(
m_d
->
image
)
{
QSize
newSize
=
m_d
->
image
->
bounds
().
size
();
QRect
bounds
=
m_d
->
image
->
bounds
();
QSize
newSize
=
bounds
.
size
();
newSize
.
scale
(
size
,
Qt
::
KeepAspectRatio
);
QImage
image
=
m_d
->
image
->
convertToQImage
(
QRect
(
0
,
0
,
newSize
.
width
(),
newSize
.
height
()),
newSize
,
0
);
QImage
image
;
if
(
bounds
.
width
()
<
10000
&&
bounds
.
height
()
<
10000
)
{
image
=
m_d
->
image
->
convertToQImage
(
m_d
->
image
->
bounds
(),
0
);
}
else
{
image
=
m_d
->
image
->
convertToQImage
(
QRect
(
0
,
0
,
newSize
.
width
(),
newSize
.
height
()),
newSize
,
0
);
}
image
=
image
.
scaled
(
newSize
,
Qt
::
KeepAspectRatio
,
Qt
::
SmoothTransformation
);
return
QPixmap
::
fromImage
(
image
);
}
return
QPixmap
(
size
);
...
...
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