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
8d1a936d
Commit
8d1a936d
authored
Dec 18, 2013
by
Halla Rempt
Browse files
BUG:328906 Fix scaling of file layer
parent
0ff91ca0
Changes
1
Hide whitespace changes
Inline
Side-by-side
krita/ui/kis_file_layer.cpp
View file @
8d1a936d
...
...
@@ -116,20 +116,24 @@ KisFileLayer::ScalingMethod KisFileLayer::scalingMethod() const
void
KisFileLayer
::
slotLoadingFinished
()
{
KisImageWSP
importedImage
=
m_loader
.
image
();
m_image
=
importedImage
->
projection
();
if
(
m_scalingMethod
==
ToImagePPI
&&
(
image
()
->
xRes
()
!=
importedImage
->
xRes
()
||
image
()
->
yRes
()
!=
importedImage
->
yRes
()))
{
||
image
()
->
yRes
()
!=
importedImage
->
yRes
()))
{
qreal
xscale
=
image
()
->
xRes
()
/
importedImage
->
xRes
();
qreal
yscale
=
image
()
->
yRes
()
/
importedImage
->
yRes
();
m_image
=
importedImage
->
projection
();
KisTransformWorker
worker
(
m_image
,
xscale
,
yscale
,
0.0
,
0.0
,
0.0
,
0
,
0
,
0
,
0
,
0
,
KisFilterStrategyRegistry
::
instance
()
->
get
(
"Bicubic"
));
worker
.
run
();
}
else
if
(
m_scalingMethod
==
ToImageSize
)
{
importedImage
->
resizeImage
(
image
()
->
bounds
());
QSize
sz
=
importedImage
->
size
();
sz
.
scale
(
image
()
->
size
(),
Qt
::
KeepAspectRatio
);
qreal
xscale
=
sz
.
width
()
/
importedImage
->
width
();
qreal
yscale
=
sz
.
height
()
/
importedImage
->
height
();
KisTransformWorker
worker
(
m_image
,
xscale
,
yscale
,
0.0
,
0.0
,
0.0
,
0
,
0
,
0
,
0
,
0
,
KisFilterStrategyRegistry
::
instance
()
->
get
(
"Bicubic"
));
worker
.
run
();
}
m_image
=
importedImage
->
projection
();
setDirty
();
}
...
...
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