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
450a4f46
Kaydet (Commit)
450a4f46
authored
Eki 02, 2014
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
android: TileIdentifier - contains tile position and zoom
Change-Id: Ia82dc1f99eff5117fe16df2b61c1a7230b52e07a
üst
e910aa45
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
34 deletions
+41
-34
DynamicTileLayer.java
...oid3/src/java/org/mozilla/gecko/gfx/DynamicTileLayer.java
+7
-7
SubTile.java
...al/LOAndroid3/src/java/org/mozilla/gecko/gfx/SubTile.java
+34
-27
No files found.
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/DynamicTileLayer.java
Dosyayı görüntüle @
450a4f46
...
...
@@ -97,10 +97,10 @@ public class DynamicTileLayer extends Layer {
tile
.
beginTransaction
();
Rect
position
=
tile
.
getPosition
();
float
positionX
=
tile
.
x
/
tile
.
zoom
;
float
positionY
=
tile
.
y
/
tile
.
zoom
;
float
tileSizeWidth
=
tileSize
.
width
/
tile
.
zoom
;
float
tileSizeHeight
=
tileSize
.
height
/
tile
.
zoom
;
float
positionX
=
tile
.
id
.
x
/
tile
.
id
.
zoom
;
float
positionY
=
tile
.
id
.
y
/
tile
.
id
.
zoom
;
float
tileSizeWidth
=
tileSize
.
width
/
tile
.
id
.
zoom
;
float
tileSizeHeight
=
tileSize
.
height
/
tile
.
id
.
zoom
;
position
.
set
((
int
)
positionX
,
(
int
)
positionY
,
(
int
)
(
positionX
+
tileSizeWidth
+
1
),
(
int
)
(
positionY
+
tileSizeHeight
+
1
));
tile
.
setPosition
(
position
);
...
...
@@ -157,7 +157,7 @@ public class DynamicTileLayer extends Layer {
}
boolean
contains
=
false
;
for
(
SubTile
tile
:
tiles
)
{
if
(
tile
.
x
==
x
&&
tile
.
y
==
y
&&
tile
.
zoom
==
viewportMetrics
.
zoomFactor
)
{
if
(
tile
.
id
.
x
==
x
&&
tile
.
id
.
y
==
y
&&
tile
.
id
.
zoom
==
viewportMetrics
.
zoomFactor
)
{
contains
=
true
;
}
}
...
...
@@ -184,8 +184,8 @@ public class DynamicTileLayer extends Layer {
private
void
markTiles
(
ImmutableViewportMetrics
viewportMetrics
)
{
for
(
SubTile
tile
:
tiles
)
{
if
(
FloatUtils
.
fuzzyEquals
(
tile
.
zoom
,
viewportMetrics
.
zoomFactor
))
{
RectF
tileRect
=
new
RectF
(
tile
.
x
,
tile
.
y
,
tile
.
x
+
tileSize
.
width
,
tile
.
y
+
tileSize
.
height
);
if
(
FloatUtils
.
fuzzyEquals
(
tile
.
id
.
zoom
,
viewportMetrics
.
zoomFactor
))
{
RectF
tileRect
=
new
RectF
(
tile
.
id
.
x
,
tile
.
id
.
y
,
tile
.
id
.
x
+
tileSize
.
width
,
tile
.
id
.
y
+
tileSize
.
height
);
if
(!
RectF
.
intersects
(
currentViewport
,
tileRect
))
{
tile
.
markForRemoval
();
}
...
...
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/SubTile.java
Dosyayı görüntüle @
450a4f46
...
...
@@ -6,42 +6,49 @@
package
org
.
mozilla
.
gecko
.
gfx
;
public
class
SubTile
extends
SingleTileLayer
{
public
int
x
;
public
int
y
;
public
float
zoom
;
public
boolean
markedForRemoval
=
false
;
public
final
TileIdentifier
id
;
public
SubTile
(
CairoImage
mImage
,
int
x
,
int
y
,
float
zoom
)
{
super
(
mImage
);
this
.
x
=
x
;
this
.
y
=
y
;
this
.
zoom
=
zoom
;
id
=
new
TileIdentifier
(
x
,
y
,
zoom
);
}
public
void
markForRemoval
()
{
markedForRemoval
=
true
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
SubTile
subTile
=
(
SubTile
)
o
;
if
(
x
!=
subTile
.
x
)
return
false
;
if
(
y
!=
subTile
.
y
)
return
false
;
if
(
Float
.
compare
(
subTile
.
zoom
,
zoom
)
!=
0
)
return
false
;
return
true
;
}
@Override
public
int
hashCode
()
{
int
result
=
x
;
result
=
31
*
result
+
y
;
result
=
31
*
result
+
(
zoom
!=
+
0.0f
?
Float
.
floatToIntBits
(
zoom
)
:
0
);
return
result
;
public
static
class
TileIdentifier
{
public
int
x
;
public
int
y
;
public
float
zoom
;
public
TileIdentifier
(
int
x
,
int
y
,
float
zoom
)
{
this
.
x
=
x
;
this
.
y
=
y
;
this
.
zoom
=
zoom
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
TileIdentifier
that
=
(
TileIdentifier
)
o
;
if
(
x
!=
that
.
x
)
return
false
;
if
(
y
!=
that
.
y
)
return
false
;
if
(
Float
.
compare
(
that
.
zoom
,
zoom
)
!=
0
)
return
false
;
return
true
;
}
@Override
public
int
hashCode
()
{
int
result
=
x
;
result
=
31
*
result
+
y
;
result
=
31
*
result
+
(
zoom
!=
+
0.0f
?
Float
.
floatToIntBits
(
zoom
)
:
0
);
return
result
;
}
}
}
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