Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
4396c1f1
Kaydet (Commit)
4396c1f1
authored
Ara 05, 2012
tarafından
Cédric Bosdonnat
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Template manager: keep thumbnails ratio when scaling down
Change-Id: Ic597dd9fd12895c0d21f678cba44feba9f6fcd47
üst
133f9264
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
3 deletions
+26
-3
templateabstractview.cxx
sfx2/source/control/templateabstractview.cxx
+26
-3
No files found.
sfx2/source/control/templateabstractview.cxx
Dosyayı görüntüle @
4396c1f1
...
...
@@ -137,10 +137,33 @@ BitmapEx TemplateAbstractView::scaleImg (const BitmapEx &rImg, long width, long
{
BitmapEx
aImg
=
rImg
;
int
sWidth
=
std
::
min
(
aImg
.
GetSizePixel
().
getWidth
(),
width
);
int
sHeight
=
std
::
min
(
aImg
.
GetSizePixel
().
getHeight
(),
height
);
if
(
!
rImg
.
IsEmpty
()
)
{
const
Size
&
aImgSize
=
aImg
.
GetSizePixel
();
double
nRatio
=
double
(
aImgSize
.
getWidth
())
/
double
(
aImgSize
.
getHeight
());
long
nDestWidth
=
aImgSize
.
getWidth
();
long
nDestHeight
=
aImgSize
.
getHeight
();
// Which one side is the overflowing most?
long
nDistW
=
aImgSize
.
getWidth
()
-
width
;
long
nDistH
=
aImgSize
.
getHeight
()
-
height
;
// Use the biggest overflow side to make it fit the destination
if
(
nDistW
>=
nDistH
&&
nDistW
>
0
)
{
nDestWidth
=
width
;
nDestHeight
=
width
/
nRatio
;
}
else
if
(
nDistW
<
nDistH
&&
nDistH
>
0
)
{
nDestHeight
=
height
;
nDestWidth
=
height
*
nRatio
;
}
aImg
.
Scale
(
Size
(
sWidth
,
sHeight
),
BMP_SCALE_INTERPOLATE
);
aImg
.
Scale
(
Size
(
nDestWidth
,
nDestHeight
));
}
return
aImg
;
}
...
...
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