Commit 30aedd67 authored by Hiroyuki Ikezoe's avatar Hiroyuki Ikezoe
Browse files

Use minus offset for vertical clipping.

After bug 1586144 the area which is initially covered by the dynamic toolbar
is outside of the ICB so that we need to use minus offsets.

https://bugzilla.mozilla.org/show_bug.cgi?id=1586144
parent 63664d89
......@@ -80,9 +80,9 @@ class GeckoEngineViewTest {
val engineView = GeckoEngineView(context)
engineView.currentGeckoView = mock()
engineView.setVerticalClipping(42)
engineView.setVerticalClipping(-42)
verify(engineView.currentGeckoView).setVerticalClipping(42)
verify(engineView.currentGeckoView).setVerticalClipping(-42)
}
@Test
......
......@@ -80,9 +80,9 @@ class GeckoEngineViewTest {
val engineView = GeckoEngineView(context)
engineView.currentGeckoView = mock()
engineView.setVerticalClipping(42)
engineView.setVerticalClipping(-42)
verify(engineView.currentGeckoView).setVerticalClipping(42)
verify(engineView.currentGeckoView).setVerticalClipping(-42)
}
@Test
......
......@@ -80,9 +80,9 @@ class GeckoEngineViewTest {
val engineView = GeckoEngineView(context)
engineView.currentGeckoView = mock()
engineView.setVerticalClipping(42)
engineView.setVerticalClipping(-42)
verify(engineView.currentGeckoView).setVerticalClipping(42)
verify(engineView.currentGeckoView).setVerticalClipping(-42)
}
@Test
......
......@@ -44,7 +44,7 @@ class EngineViewBottomBehavior(
*/
override fun onDependentViewChanged(parent: CoordinatorLayout, child: View, dependency: View): Boolean {
val engineView = child.findViewInHierarchy { it is EngineView } as EngineView?
engineView?.setVerticalClipping(dependency.height - dependency.translationY.toInt())
engineView?.setVerticalClipping(-dependency.translationY.toInt())
return true
}
}
......@@ -36,7 +36,7 @@ class EngineViewBottomBehaviorTest {
doReturn(42f).`when`(toolbar).translationY
behavior.onDependentViewChanged(mock(), engineView.asView(), toolbar)
verify(engineView).setVerticalClipping(58)
verify(engineView).setVerticalClipping(-42)
}
@Test
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment