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
16222190
Kaydet (Commit)
16222190
authored
Haz 08, 2015
tarafından
Pranav Kant
Kaydeden (comit)
Miklos Vajna
Haz 09, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
tilebuffer: ZoomFactor as member variable is superfluous
Change-Id: I9f533f577f959c9a715e5214be99ca59cb0d206c
üst
03655e67
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
32 deletions
+10
-32
lokdocview.cxx
libreofficekit/source/gtk/lokdocview.cxx
+5
-2
tilebuffer.cxx
libreofficekit/source/gtk/tilebuffer.cxx
+5
-16
tilebuffer.hxx
libreofficekit/source/gtk/tilebuffer.hxx
+0
-14
No files found.
libreofficekit/source/gtk/lokdocview.cxx
Dosyayı görüntüle @
16222190
...
...
@@ -846,7 +846,7 @@ void LOKDocView_Impl::renderDocument(GdkRectangle* pPartial)
{
//g_info("tile_buffer_get_tile (%d, %d)", nRow, nColumn);
Tile
&
currentTile
=
m_aTileBuffer
.
getTile
(
nRow
,
nColumn
);
Tile
&
currentTile
=
m_aTileBuffer
.
getTile
(
nRow
,
nColumn
,
m_fZoom
);
GdkPixbuf
*
pPixBuf
=
currentTile
.
getBuffer
();
gdk_cairo_set_source_pixbuf
(
pcairo
,
pPixBuf
,
...
...
@@ -1262,7 +1262,10 @@ SAL_DLLPUBLIC_EXPORT void lok_doc_view_set_zoom ( LOKDocView* pDocView, float fZ
guint
nRows
=
ceil
((
double
)
nDocumentHeightPixels
/
nTileSizePixels
);
guint
nColumns
=
ceil
((
double
)
nDocumentWidthPixels
/
nTileSizePixels
);
pDocView
->
m_pImpl
->
m_aTileBuffer
.
setZoom
(
fZoom
,
nRows
,
nColumns
);
pDocView
->
m_pImpl
->
m_aTileBuffer
=
TileBuffer
(
pDocView
->
m_pImpl
->
m_pDocument
,
nTileSizePixels
,
nRows
,
nColumns
);
gtk_widget_set_size_request
(
pDocView
->
m_pImpl
->
m_pDrawingArea
,
nDocumentWidthPixels
,
nDocumentHeightPixels
);
...
...
libreofficekit/source/gtk/tilebuffer.cxx
Dosyayı görüntüle @
16222190
...
...
@@ -51,17 +51,6 @@ void Tile::setPixbuf(GdkPixbuf *buffer)
TileBuffer class member functions
----------------------------------
*/
void
TileBuffer
::
setZoom
(
float
newZoomFactor
,
int
rows
,
int
columns
)
{
m_fZoomFactor
=
newZoomFactor
;
resetAllTiles
();
// set new buffer width and height
m_nWidth
=
columns
;
m_nHeight
=
rows
;
}
void
TileBuffer
::
resetAllTiles
()
{
std
::
map
<
int
,
Tile
>::
iterator
it
=
m_mTiles
.
begin
();
...
...
@@ -84,7 +73,7 @@ void TileBuffer::setInvalid(int x, int y)
}
}
Tile
&
TileBuffer
::
getTile
(
int
x
,
int
y
)
Tile
&
TileBuffer
::
getTile
(
int
x
,
int
y
,
float
aZoom
)
{
int
index
=
x
*
m_nWidth
+
y
;
if
(
m_mTiles
.
find
(
index
)
==
m_mTiles
.
end
()
||
!
m_mTiles
[
index
].
valid
)
...
...
@@ -99,16 +88,16 @@ Tile& TileBuffer::getTile(int x, int y)
unsigned
char
*
pBuffer
=
gdk_pixbuf_get_pixels
(
pPixBuf
);
GdkRectangle
aTileRectangle
;
aTileRectangle
.
x
=
pixelToTwip
(
m_nTileSize
,
m_fZoomFactor
)
*
y
;
aTileRectangle
.
y
=
pixelToTwip
(
m_nTileSize
,
m_fZoomFactor
)
*
x
;
aTileRectangle
.
x
=
pixelToTwip
(
m_nTileSize
,
aZoom
)
*
y
;
aTileRectangle
.
y
=
pixelToTwip
(
m_nTileSize
,
aZoom
)
*
x
;
g_info
(
"Rendering (%d, %d)"
,
x
,
y
);
m_pLOKDocument
->
pClass
->
paintTile
(
m_pLOKDocument
,
pBuffer
,
m_nTileSize
,
m_nTileSize
,
aTileRectangle
.
x
,
aTileRectangle
.
y
,
pixelToTwip
(
m_nTileSize
,
m_fZoomFactor
),
pixelToTwip
(
m_nTileSize
,
m_fZoomFactor
));
pixelToTwip
(
m_nTileSize
,
aZoom
),
pixelToTwip
(
m_nTileSize
,
aZoom
));
//create a mapping for it
m_mTiles
[
index
].
setPixbuf
(
pPixBuf
);
...
...
libreofficekit/source/gtk/tilebuffer.hxx
Dosyayı görüntüle @
16222190
...
...
@@ -88,24 +88,12 @@ class TileBuffer
int
columns
)
:
m_pLOKDocument
(
document
)
,
m_nTileSize
(
tileSize
)
,
m_fZoomFactor
(
1
)
,
m_nWidth
(
columns
)
,
m_nHeight
(
rows
)
{
}
~
TileBuffer
()
{}
/**
Sets the zoom factor (m_fZoomFactor) for this tile buffer. Setting the
zoom factor invalidates whole of the tile buffer, destroys all tiles
contained within it, and sets new width, height values for tile
buffer. The width, height value of tile buffer is the width and height of
the table containing all possible tiles (rendered and non-rendered) that
this buffer can have.
@param zoomFactor the new zoom factor value to set
*/
void
setZoom
(
float
zoomFactor
,
int
rows
,
int
columns
);
/**
Gets the underlying Tile object for given position. The position (0, 0)
points to the left top most tile of the buffer.
...
...
@@ -137,8 +125,6 @@ class TileBuffer
LibreOfficeKitDocument
*
m_pLOKDocument
;
/// The side of each squared tile in pixels.
int
m_nTileSize
;
/// The zoom factor that the tile buffer is currently rendered to.
float
m_fZoomFactor
;
/// Stores all the tiles cached by this tile buffer.
std
::
map
<
int
,
Tile
>
m_mTiles
;
/// Width of the current tile buffer (number of columns)
...
...
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