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
0151bf3f
Kaydet (Commit)
0151bf3f
authored
Eyl 27, 2014
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
android: move scrollBy & scaleWithFocus to PZC (Fennec Import)
Change-Id: Ie0d23b302994134f9d382e255b0408f7c9f1c1fb
üst
94e7296f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
36 deletions
+32
-36
LayerController.java
...roid3/src/java/org/mozilla/gecko/gfx/LayerController.java
+0
-27
PanZoomController.java
...oid3/src/java/org/mozilla/gecko/ui/PanZoomController.java
+32
-7
PanZoomTarget.java
...Android3/src/java/org/mozilla/gecko/ui/PanZoomTarget.java
+0
-2
No files found.
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerController.java
Dosyayı görüntüle @
0151bf3f
...
...
@@ -135,18 +135,6 @@ public class LayerController implements PanZoomTarget {
}
}
/** Scrolls the viewport by the given offset. You must hold the monitor while calling this. */
public
void
scrollBy
(
PointF
point
)
{
ViewportMetrics
viewportMetrics
=
new
ViewportMetrics
(
mViewportMetrics
);
PointF
origin
=
viewportMetrics
.
getOrigin
();
origin
.
offset
(
point
.
x
,
point
.
y
);
viewportMetrics
.
setOrigin
(
origin
);
mViewportMetrics
=
new
ImmutableViewportMetrics
(
viewportMetrics
);
notifyLayerClientOfGeometryChange
();
mView
.
requestRender
();
}
/** Sets the current page rect. You must hold the monitor while calling this. */
public
void
setPageRect
(
RectF
rect
,
RectF
cssRect
)
{
// Since the "rect" is always just a multiple of "cssRect" we don't need to
...
...
@@ -193,21 +181,6 @@ public class LayerController implements PanZoomTarget {
}
}
/**
* Scales the viewport, keeping the given focus point in the same place before and after the
* scale operation. You must hold the monitor while calling this.
*/
public
void
scaleWithFocus
(
float
zoomFactor
,
PointF
focus
)
{
ViewportMetrics
viewportMetrics
=
new
ViewportMetrics
(
mViewportMetrics
);
viewportMetrics
.
scaleTo
(
zoomFactor
,
focus
);
mViewportMetrics
=
new
ImmutableViewportMetrics
(
viewportMetrics
);
// We assume the zoom level will only be modified by the
// PanZoomController, so no need to notify it of this change.
notifyLayerClientOfGeometryChange
();
mView
.
requestRender
();
}
public
boolean
post
(
Runnable
action
)
{
return
mView
.
post
(
action
);
}
/**
...
...
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/ui/PanZoomController.java
Dosyayı görüntüle @
0151bf3f
...
...
@@ -133,6 +133,10 @@ public class PanZoomController
return
mTarget
.
getViewportMetrics
();
}
private
ViewportMetrics
getMutableMetrics
()
{
return
new
ViewportMetrics
(
getMetrics
());
}
// for debugging bug 713011; it can be taken out once that is resolved.
private
void
checkMainThread
()
{
if
(
mMainThread
!=
Thread
.
currentThread
())
{
...
...
@@ -225,7 +229,7 @@ public class PanZoomController
if
(
mState
==
PanZoomState
.
NOTHING
)
{
synchronized
(
mTarget
.
getLock
())
{
ViewportMetrics
validated
=
getValidViewportMetrics
();
if
(!
(
new
ViewportMetrics
(
getMetrics
())
).
fuzzyEquals
(
validated
))
{
if
(!
getMutableMetrics
(
).
fuzzyEquals
(
validated
))
{
// page size changed such that we are now in overscroll. snap to the
// the nearest valid viewport
mTarget
.
setViewportMetrics
(
validated
);
...
...
@@ -449,6 +453,16 @@ public class PanZoomController
updatePosition
();
}
private
void
scrollBy
(
PointF
point
)
{
ViewportMetrics
viewportMetrics
=
getMutableMetrics
();
PointF
origin
=
viewportMetrics
.
getOrigin
();
origin
.
offset
(
point
.
x
,
point
.
y
);
viewportMetrics
.
setOrigin
(
origin
);
mTarget
.
setViewportMetrics
(
viewportMetrics
);
mTarget
.
notifyLayerClientOfGeometryChange
();
}
private
void
fling
()
{
updatePosition
();
...
...
@@ -465,7 +479,7 @@ public class PanZoomController
private
void
bounce
(
ViewportMetrics
metrics
)
{
stopAnimationTimer
();
ViewportMetrics
bounceStartMetrics
=
new
ViewportMetrics
(
getMetrics
()
);
ViewportMetrics
bounceStartMetrics
=
getMutableMetrics
(
);
if
(
bounceStartMetrics
.
fuzzyEquals
(
metrics
))
{
setState
(
PanZoomState
.
NOTHING
);
return
;
...
...
@@ -539,7 +553,7 @@ public class PanZoomController
}
if
(!
mSubscroller
.
scrollBy
(
displacement
))
{
synchronized
(
mTarget
.
getLock
())
{
mTarget
.
scrollBy
(
displacement
);
scrollBy
(
displacement
);
}
}
}
...
...
@@ -690,7 +704,7 @@ public class PanZoomController
/* Returns the nearest viewport metrics with no overscroll visible. */
private
ViewportMetrics
getValidViewportMetrics
()
{
return
getValidViewportMetrics
(
new
ViewportMetrics
(
getMetrics
()
));
return
getValidViewportMetrics
(
getMutableMetrics
(
));
}
private
ViewportMetrics
getValidViewportMetrics
(
ViewportMetrics
viewportMetrics
)
{
...
...
@@ -848,10 +862,10 @@ public class PanZoomController
newZoomFactor
=
maxZoomFactor
+
excessZoom
;
}
mTarget
.
scrollBy
(
new
PointF
(
mLastZoomFocus
.
x
-
detector
.
getFocusX
(),
scrollBy
(
new
PointF
(
mLastZoomFocus
.
x
-
detector
.
getFocusX
(),
mLastZoomFocus
.
y
-
detector
.
getFocusY
()));
PointF
focus
=
new
PointF
(
detector
.
getFocusX
(),
detector
.
getFocusY
());
mTarget
.
scaleWithFocus
(
newZoomFactor
,
focus
);
scaleWithFocus
(
newZoomFactor
,
focus
);
}
mLastZoomFocus
.
set
(
detector
.
getFocusX
(),
detector
.
getFocusY
());
...
...
@@ -872,6 +886,17 @@ public class PanZoomController
mTarget
.
notifyLayerClientOfGeometryChange
();
}
/**
* Scales the viewport, keeping the given focus point in the same place before and after the
* scale operation. You must hold the monitor while calling this.
*/
private
void
scaleWithFocus
(
float
zoomFactor
,
PointF
focus
)
{
ViewportMetrics
viewportMetrics
=
getMutableMetrics
();
viewportMetrics
.
scaleTo
(
zoomFactor
,
focus
);
mTarget
.
setViewportMetrics
(
viewportMetrics
);
mTarget
.
notifyLayerClientOfGeometryChange
();
}
public
boolean
getRedrawHint
()
{
switch
(
mState
)
{
case
PINCHING:
...
...
@@ -944,7 +969,7 @@ public class PanZoomController
float
finalZoom
=
viewport
.
width
()
/
zoomToRect
.
width
();
ViewportMetrics
finalMetrics
=
new
ViewportMetrics
(
getMetrics
()
);
ViewportMetrics
finalMetrics
=
getMutableMetrics
(
);
finalMetrics
.
setOrigin
(
new
PointF
(
zoomToRect
.
left
*
finalMetrics
.
getZoomFactor
(),
zoomToRect
.
top
*
finalMetrics
.
getZoomFactor
()));
finalMetrics
.
scaleTo
(
finalZoom
,
new
PointF
(
0.0f
,
0.0f
));
...
...
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/ui/PanZoomTarget.java
Dosyayı görüntüle @
0151bf3f
...
...
@@ -17,8 +17,6 @@ public interface PanZoomTarget {
public
void
setAnimationTarget
(
ViewportMetrics
viewport
);
public
void
setViewportMetrics
(
ViewportMetrics
viewport
);
public
void
scrollBy
(
PointF
point
);
public
void
scaleWithFocus
(
float
zoomFactor
,
PointF
focus
);
public
void
notifyLayerClientOfGeometryChange
();
public
void
setForceRedraw
();
...
...
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