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
2b61e26c
Kaydet (Commit)
2b61e26c
authored
Agu 03, 2014
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
LOAndroid3: correctly calculate which tiles to draw
Change-Id: I195a318c8ce86cfcb12f724e04c115e0de444345
üst
370f05aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
17 deletions
+19
-17
LOKitThread.java
...ntal/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
+19
-17
No files found.
android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
Dosyayı görüntüle @
2b61e26c
...
...
@@ -26,6 +26,20 @@ public class LOKitThread extends Thread {
mInputFile
=
inputFile
;
}
RectF
normlizeRect
(
ViewportMetrics
metrics
)
{
RectF
rect
=
metrics
.
getViewport
();
float
zoomFactor
=
metrics
.
getZoomFactor
();
return
new
RectF
(
rect
.
left
/
zoomFactor
,
rect
.
top
/
zoomFactor
,
rect
.
right
/
zoomFactor
,
rect
.
bottom
/
zoomFactor
);
}
Rect
roundToTileSize
(
RectF
input
,
int
tileSize
)
{
int
minX
=
(
Math
.
round
(
input
.
left
)
/
tileSize
)
*
tileSize
;
int
minY
=
(
Math
.
round
(
input
.
top
)
/
tileSize
)
*
tileSize
;
int
maxX
=
((
Math
.
round
(
input
.
right
)
/
tileSize
)
+
1
)
*
tileSize
;
int
maxY
=
((
Math
.
round
(
input
.
bottom
)
/
tileSize
)
+
1
)
*
tileSize
;
return
new
Rect
(
minX
,
minY
,
maxX
,
maxY
);
}
private
boolean
draw
()
throws
InterruptedException
{
int
pageWidth
=
mTileProvider
.
getPageWidth
();
int
pageHeight
=
mTileProvider
.
getPageHeight
();
...
...
@@ -34,27 +48,15 @@ public class LOKitThread extends Thread {
mViewportMetrics
.
setPageSize
(
new
FloatSize
(
pageWidth
,
pageHeight
));
GeckoLayerClient
layerClient
=
mApplication
.
getLayerClient
();
ViewportMetrics
metrics
=
mApplication
.
getLayerController
().
getViewportMetrics
();
RectF
viewport
=
metrics
.
getClampedViewport
();
float
zoomFactor
=
metrics
.
getZoomFactor
();
boolean
shouldContinue
=
layerClient
.
beginDrawing
(
mViewportMetrics
);
if
(!
shouldContinue
)
{
return
false
;
}
int
minX
=
((
int
)
viewport
.
left
/
TILE_SIZE
)
*
TILE_SIZE
;
int
minY
=
((
int
)
viewport
.
top
/
TILE_SIZE
)
*
TILE_SIZE
;
int
maxX
=
(((
int
)
viewport
.
right
/
TILE_SIZE
)
+
1
)
*
TILE_SIZE
;
int
maxY
=
(((
int
)
viewport
.
bottom
/
TILE_SIZE
)
+
1
)
*
TILE_SIZE
;
Rect
rect
=
new
Rect
(
Math
.
round
(
minX
/
zoomFactor
),
Math
.
round
(
minY
/
zoomFactor
),
Math
.
round
(
maxX
/
zoomFactor
),
Math
.
round
(
maxY
/
zoomFactor
));
ViewportMetrics
metrics
=
mApplication
.
getLayerController
().
getViewportMetrics
();
RectF
viewport
=
normlizeRect
(
metrics
);
Rect
rect
=
roundToTileSize
(
viewport
,
TILE_SIZE
);
ArrayList
<
SubTile
>
removeTiles
=
new
ArrayList
<
SubTile
>();
for
(
SubTile
tile
:
layerClient
.
getTiles
())
{
...
...
@@ -64,8 +66,8 @@ public class LOKitThread extends Thread {
}
layerClient
.
getTiles
().
removeAll
(
removeTiles
);
for
(
int
y
=
minY
;
y
<=
maxY
;
y
+=
TILE_SIZE
)
{
for
(
int
x
=
minX
;
x
<=
maxX
;
x
+=
TILE_SIZE
)
{
for
(
int
y
=
rect
.
top
;
y
<=
rect
.
bottom
;
y
+=
TILE_SIZE
)
{
for
(
int
x
=
rect
.
left
;
x
<=
rect
.
right
;
x
+=
TILE_SIZE
)
{
if
(
x
>
pageWidth
)
{
continue
;
}
...
...
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