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
2104f864
Kaydet (Commit)
2104f864
authored
Eki 14, 2013
tarafından
Armin Le Grand
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
i123438 Corrected crop for clipboard mitmap data preparations
üst
6a734112
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
23 deletions
+40
-23
grfmgr.cxx
svtools/source/graphic/grfmgr.cxx
+40
-23
No files found.
svtools/source/graphic/grfmgr.cxx
Dosyayı görüntüle @
2104f864
...
...
@@ -946,23 +946,25 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo
if
(
aMapGraph
==
MAP_PIXEL
)
{
aCropLeftTop
=
Application
::
GetDefaultDevice
()
->
LogicToPixel
(
Size
(
rAttr
.
GetLeftCrop
(),
rAttr
.
GetTopCrop
()
),
aMap100
);
aCropRightBottom
=
Application
::
GetDefaultDevice
()
->
LogicToPixel
(
Size
(
rAttr
.
GetRightCrop
(),
rAttr
.
GetBottomCrop
()
),
aMap100
);
// crops are in 1/100th mm -> to aMapGraph -> to MAP_PIXEL
aCropLeftTop
=
Application
::
GetDefaultDevice
()
->
LogicToPixel
(
Size
(
rAttr
.
GetLeftCrop
(),
rAttr
.
GetTopCrop
()),
aMap100
);
aCropRightBottom
=
Application
::
GetDefaultDevice
()
->
LogicToPixel
(
Size
(
rAttr
.
GetRightCrop
(),
rAttr
.
GetBottomCrop
()),
aMap100
);
}
else
{
aCropLeftTop
=
OutputDevice
::
LogicToLogic
(
Size
(
rAttr
.
GetLeftCrop
(),
rAttr
.
GetTopCrop
()
),
aMap100
,
aMapGraph
);
aCropRightBottom
=
OutputDevice
::
LogicToLogic
(
Size
(
rAttr
.
GetRightCrop
(),
rAttr
.
GetBottomCrop
()
),
aMap100
,
aMapGraph
);
// crops are in GraphicObject units -> to aMapGraph
aCropLeftTop
=
OutputDevice
::
LogicToLogic
(
Size
(
rAttr
.
GetLeftCrop
(),
rAttr
.
GetTopCrop
()),
aMap100
,
aMapGraph
);
aCropRightBottom
=
OutputDevice
::
LogicToLogic
(
Size
(
rAttr
.
GetRightCrop
(),
rAttr
.
GetBottomCrop
()),
aMap100
,
aMapGraph
);
}
// #104115# If the metafile is cropped, give it a special
...
...
@@ -1012,15 +1014,29 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo
BitmapEx
aBitmapEx
(
aTransGraphic
.
GetBitmapEx
()
);
Rectangle
aCropRect
;
// convert crops to pixel
(crops are always in GraphicObject units)
// convert crops to pixel
if
(
rAttr
.
IsCropped
())
{
aCropLeftTop
=
Application
::
GetDefaultDevice
()
->
LogicToPixel
(
Size
(
rAttr
.
GetLeftCrop
(),
rAttr
.
GetTopCrop
()),
aMapGraph
);
aCropRightBottom
=
Application
::
GetDefaultDevice
()
->
LogicToPixel
(
Size
(
rAttr
.
GetRightCrop
(),
rAttr
.
GetBottomCrop
()),
aMapGraph
);
if
(
aMapGraph
==
MAP_PIXEL
)
{
// crops are in 1/100th mm -> to MAP_PIXEL
aCropLeftTop
=
Application
::
GetDefaultDevice
()
->
LogicToPixel
(
Size
(
rAttr
.
GetLeftCrop
(),
rAttr
.
GetTopCrop
()),
aMap100
);
aCropRightBottom
=
Application
::
GetDefaultDevice
()
->
LogicToPixel
(
Size
(
rAttr
.
GetRightCrop
(),
rAttr
.
GetBottomCrop
()),
aMap100
);
}
else
{
// crops are in GraphicObject units -> to MAP_PIXEL
aCropLeftTop
=
Application
::
GetDefaultDevice
()
->
LogicToPixel
(
Size
(
rAttr
.
GetLeftCrop
(),
rAttr
.
GetTopCrop
()),
aMapGraph
);
aCropRightBottom
=
Application
::
GetDefaultDevice
()
->
LogicToPixel
(
Size
(
rAttr
.
GetRightCrop
(),
rAttr
.
GetBottomCrop
()),
aMapGraph
);
}
// convert from prefmapmode to pixel
Size
aSrcSizePixel
(
...
...
@@ -1040,8 +1056,9 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo
// another possibility is to adapt the values created so far with a factor; this
// will keep the original Bitmap untouched and thus quality will not change
const
double
fFactorX
(
aBitmapEx
.
GetSizePixel
().
Width
()
/
aSrcSizePixel
.
Width
());
const
double
fFactorY
(
aBitmapEx
.
GetSizePixel
().
Height
()
/
aSrcSizePixel
.
Height
());
// caution: convert to double first, else pretty big errors may occurr
const
double
fFactorX
((
double
)
aBitmapEx
.
GetSizePixel
().
Width
()
/
aSrcSizePixel
.
Width
());
const
double
fFactorY
((
double
)
aBitmapEx
.
GetSizePixel
().
Height
()
/
aSrcSizePixel
.
Height
());
aCropLeftTop
.
Width
()
=
basegfx
::
fround
(
aCropLeftTop
.
Width
()
*
fFactorX
);
aCropLeftTop
.
Height
()
=
basegfx
::
fround
(
aCropLeftTop
.
Height
()
*
fFactorY
);
...
...
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