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
8e21a025
Kaydet (Commit)
8e21a025
authored
Tem 18, 2014
tarafından
Norbert Thiebaud
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
vcl: add floating equivalent for MapRes
Change-Id: I165e403d2834d341f7da7a280859afccb995a3bb
üst
2b8528a2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
2 deletions
+62
-2
outdev.hxx
include/vcl/outdev.hxx
+3
-0
outdevmap.hxx
include/vcl/outdevmap.hxx
+4
-1
map.cxx
vcl/source/outdev/map.cxx
+51
-1
outdev.cxx
vcl/source/outdev/outdev.cxx
+4
-0
No files found.
include/vcl/outdev.hxx
Dosyayı görüntüle @
8e21a025
...
...
@@ -1728,6 +1728,9 @@ public:
*/
SAL_DLLPRIVATE
long
ImplLogicWidthToDevicePixel
(
long
nWidth
)
const
;
SAL_DLLPRIVATE
DeviceCoordinate
LogicWidthToDeviceCoordinate
(
long
nWidth
)
const
;
SAL_DLLPRIVATE
DeviceCoordinate
LogicHeightToDeviceCoordinate
(
long
nHeight
)
const
;
private
:
/** Convert a logical X coordinate to a device pixel's X coordinate.
...
...
include/vcl/outdevmap.hxx
Dosyayı görüntüle @
8e21a025
...
...
@@ -20,7 +20,6 @@
#ifndef INCLUDED_VCL_OUTDEVMAP_HXX
#define INCLUDED_VCL_OUTDEVMAP_HXX
struct
ImplMapRes
{
long
mnMapOfsX
;
// Offset in X direction
...
...
@@ -29,6 +28,10 @@ struct ImplMapRes
long
mnMapScNumY
;
// Scaling factor - numerator in Y direction
long
mnMapScDenomX
;
// Scaling factor - denominator in X direction
long
mnMapScDenomY
;
// Scaling factor - denominator in Y direction
double
mfOffsetX
;
double
mfOffsetY
;
double
mfScaleX
;
double
mfScaleY
;
};
struct
ImplThresholdRes
...
...
vcl/source/outdev/map.cxx
Dosyayı görüntüle @
8e21a025
...
...
@@ -149,6 +149,8 @@ static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY,
static
void
ImplCalcMapResolution
(
const
MapMode
&
rMapMode
,
long
nDPIX
,
long
nDPIY
,
ImplMapRes
&
rMapRes
)
{
rMapRes
.
mfScaleX
=
1.0
;
rMapRes
.
mfScaleY
=
1.0
;
switch
(
rMapMode
.
GetMapUnit
()
)
{
case
MAP_RELATIVE
:
...
...
@@ -254,9 +256,18 @@ static void ImplCalcMapResolution( const MapMode& rMapMode,
{
rMapRes
.
mnMapOfsX
=
aOrigin
.
X
();
rMapRes
.
mnMapOfsY
=
aOrigin
.
Y
();
rMapRes
.
mfOffsetX
=
aOrigin
.
X
();
rMapRes
.
mfOffsetY
=
aOrigin
.
Y
();
}
else
{
rMapRes
.
mfOffsetX
*=
aScaleX
.
GetDenominator
();
rMapRes
.
mfOffsetX
/=
aScaleX
.
GetNumerator
();
rMapRes
.
mfOffsetX
+=
aOrigin
.
X
();
rMapRes
.
mfOffsetY
*=
aScaleY
.
GetDenominator
();
rMapRes
.
mfOffsetY
/=
aScaleY
.
GetNumerator
();
rMapRes
.
mfOffsetY
+=
aOrigin
.
Y
();
BigInt
aX
(
rMapRes
.
mnMapOfsX
);
aX
*=
BigInt
(
aScaleX
.
GetDenominator
()
);
if
(
rMapRes
.
mnMapOfsX
>=
0
)
...
...
@@ -295,6 +306,11 @@ static void ImplCalcMapResolution( const MapMode& rMapMode,
rMapRes
.
mnMapOfsY
=
(
long
)
aY
+
aOrigin
.
Y
();
}
rMapRes
.
mfScaleX
*=
(
double
)
rMapRes
.
mnMapScNumX
*
(
double
)
aScaleX
.
GetNumerator
()
/
((
double
)
rMapRes
.
mnMapScDenomX
*
(
double
)
aScaleX
.
GetDenominator
());
rMapRes
.
mfScaleY
*=
(
double
)
rMapRes
.
mnMapScNumY
*
(
double
)
aScaleY
.
GetNumerator
()
/
((
double
)
rMapRes
.
mnMapScDenomY
*
(
double
)
aScaleY
.
GetDenominator
());
// calculate scaling factor according to MapMode
// aTemp? = rMapRes.mnMapSc? * aScale?
Fraction
aTempX
=
ImplMakeFraction
(
rMapRes
.
mnMapScNumX
,
...
...
@@ -351,7 +367,6 @@ void OutputDevice::ImplInvalidateViewTransform()
}
}
static
long
ImplLogicToPixel
(
long
n
,
long
nDPI
,
long
nMapNum
,
long
nMapDenom
,
long
nThres
)
{
...
...
@@ -719,6 +734,8 @@ void OutputDevice::SetMapMode( const MapMode& rNewMapMode )
Point
aOrigin
=
rNewMapMode
.
GetOrigin
();
maMapRes
.
mnMapOfsX
=
aOrigin
.
X
();
maMapRes
.
mnMapOfsY
=
aOrigin
.
Y
();
maMapRes
.
mfOffsetX
=
aOrigin
.
X
();
maMapRes
.
mfOffsetY
=
aOrigin
.
Y
();
maMapMode
=
rNewMapMode
;
// #i75163#
...
...
@@ -734,6 +751,10 @@ void OutputDevice::SetMapMode( const MapMode& rNewMapMode )
maMapRes
.
mnMapScDenomY
=
mnDPIY
;
maMapRes
.
mnMapOfsX
=
0
;
maMapRes
.
mnMapOfsY
=
0
;
maMapRes
.
mfOffsetX
=
0.0
;
maMapRes
.
mfOffsetY
=
0.0
;
maMapRes
.
mfScaleX
=
(
double
)
1
/
(
double
)
mnDPIX
;
maMapRes
.
mfScaleY
=
(
double
)
1
/
(
double
)
mnDPIY
;
}
// calculate new MapMode-resolution
...
...
@@ -2112,4 +2133,33 @@ long Window::ImplLogicUnitToPixelY( long nY, MapUnit eUnit )
return
nY
;
}
DeviceCoordinate
OutputDevice
::
LogicWidthToDeviceCoordinate
(
long
nWidth
)
const
{
#if VCL_FLOAT_DEVICE_PIXEL
return
(
double
)
nWidth
*
maMapRes
.
mfScaleX
*
mnDPIX
;
#else
if
(
!
mbMap
)
return
nWidth
;
return
ImplLogicToPixel
(
nWidth
,
mnDPIX
,
maMapRes
.
mnMapScNumX
,
maMapRes
.
mnMapScDenomX
,
maThresRes
.
mnThresLogToPixX
);
#endif
}
DeviceCoordinate
OutputDevice
::
LogicHeightToDeviceCoordinate
(
long
nHeight
)
const
{
#if VCL_FLOAT_DEVICE_PIXEL
return
(
double
)
nHeight
*
maMapRes
.
mfScaleY
*
mnDPIY
;
#else
if
(
!
mbMap
)
return
nHeight
;
return
ImplLogicToPixel
(
nHeight
,
mnDPIY
,
maMapRes
.
mnMapScNumY
,
maMapRes
.
mnMapScDenomY
,
maThresRes
.
mnThresLogToPixY
);
#endif
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/source/outdev/outdev.cxx
Dosyayı görüntüle @
8e21a025
...
...
@@ -159,6 +159,10 @@ OutputDevice::OutputDevice() :
maMapRes
.
mnMapScNumY
=
1
;
maMapRes
.
mnMapScDenomX
=
1
;
maMapRes
.
mnMapScDenomY
=
1
;
maMapRes
.
mfOffsetX
=
0.0
;
maMapRes
.
mfOffsetY
=
0.0
;
maMapRes
.
mfScaleX
=
1.0
;
maMapRes
.
mfScaleY
=
1.0
;
// struct ImplThresholdRes
maThresRes
.
mnThresLogToPixX
=
0
;
maThresRes
.
mnThresLogToPixY
=
0
;
...
...
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