2012-07-19 23:48:25 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set sw=4 ts=8 et tw=80 : */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "Axis.h"
|
|
|
|
#include "AsyncPanZoomController.h"
|
2013-01-09 22:11:25 -08:00
|
|
|
#include "mozilla/Preferences.h"
|
2013-01-24 06:05:18 -08:00
|
|
|
#include "nsThreadUtils.h"
|
2013-01-15 04:22:03 -08:00
|
|
|
#include <algorithm>
|
2012-07-19 23:48:25 -07:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
2012-07-22 18:43:37 -07:00
|
|
|
static const float EPSILON = 0.0001f;
|
2012-07-19 23:48:25 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Maximum acceleration that can happen between two frames. Velocity is
|
|
|
|
* throttled if it's above this. This may happen if a time delta is very low,
|
|
|
|
* or we get a touch point very far away from the previous position for some
|
|
|
|
* reason.
|
|
|
|
*/
|
2013-01-09 22:11:25 -08:00
|
|
|
static float gMaxEventAcceleration = 999.0f;
|
2012-07-19 23:48:25 -07:00
|
|
|
|
|
|
|
/**
|
2012-08-13 21:08:38 -07:00
|
|
|
* Amount of friction applied during flings.
|
2012-07-19 23:48:25 -07:00
|
|
|
*/
|
2013-01-14 13:02:41 -08:00
|
|
|
static float gFlingFriction = 0.006f;
|
2012-07-19 23:48:25 -07:00
|
|
|
|
|
|
|
/**
|
2012-08-13 21:08:38 -07:00
|
|
|
* Threshold for velocity beneath which we turn off any acceleration we had
|
|
|
|
* during repeated flings.
|
2012-07-19 23:48:25 -07:00
|
|
|
*/
|
2013-01-09 22:11:25 -08:00
|
|
|
static float gVelocityThreshold = 0.14f;
|
2012-07-19 23:48:25 -07:00
|
|
|
|
|
|
|
/**
|
2012-08-13 21:08:38 -07:00
|
|
|
* Amount of acceleration we multiply in each time the user flings in one
|
|
|
|
* direction. Every time they let go of the screen, we increase the acceleration
|
|
|
|
* by this amount raised to the power of the amount of times they have let go,
|
|
|
|
* times two (to make the curve steeper). This stops if the user lets go and we
|
|
|
|
* slow down enough, or if they put their finger down without moving it for a
|
|
|
|
* moment (or in the opposite direction).
|
2012-07-19 23:48:25 -07:00
|
|
|
*/
|
2013-01-09 22:11:25 -08:00
|
|
|
static float gAccelerationMultiplier = 1.125f;
|
2012-07-19 23:48:25 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* When flinging, if the velocity goes below this number, we just stop the
|
|
|
|
* animation completely. This is to prevent asymptotically approaching 0
|
|
|
|
* velocity and rerendering unnecessarily.
|
|
|
|
*/
|
2013-01-09 22:11:25 -08:00
|
|
|
static float gFlingStoppedThreshold = 0.01f;
|
|
|
|
|
2013-02-20 14:59:15 -08:00
|
|
|
/**
|
|
|
|
* Maximum size of velocity queue. The queue contains last N velocity records.
|
|
|
|
* On touch end we calculate the average velocity in order to compensate
|
|
|
|
* touch/mouse drivers misbehaviour.
|
|
|
|
*/
|
|
|
|
static int gMaxVelocityQueueSize = 5;
|
|
|
|
|
2013-01-09 22:11:25 -08:00
|
|
|
static void ReadAxisPrefs()
|
|
|
|
{
|
|
|
|
Preferences::AddFloatVarCache(&gMaxEventAcceleration, "gfx.axis.max_event_acceleration", gMaxEventAcceleration);
|
|
|
|
Preferences::AddFloatVarCache(&gFlingFriction, "gfx.axis.fling_friction", gFlingFriction);
|
|
|
|
Preferences::AddFloatVarCache(&gVelocityThreshold, "gfx.axis.velocity_threshold", gVelocityThreshold);
|
|
|
|
Preferences::AddFloatVarCache(&gAccelerationMultiplier, "gfx.axis.acceleration_multiplier", gAccelerationMultiplier);
|
|
|
|
Preferences::AddFloatVarCache(&gFlingStoppedThreshold, "gfx.axis.fling_stopped_threshold", gFlingStoppedThreshold);
|
2013-02-20 14:59:15 -08:00
|
|
|
Preferences::AddIntVarCache(&gMaxVelocityQueueSize, "gfx.axis.max_velocity_queue_size", gMaxVelocityQueueSize);
|
2013-01-09 22:11:25 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
class ReadAxisPref MOZ_FINAL : public nsRunnable {
|
|
|
|
public:
|
|
|
|
NS_IMETHOD Run()
|
|
|
|
{
|
|
|
|
ReadAxisPrefs();
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
static void InitAxisPrefs()
|
|
|
|
{
|
|
|
|
static bool sInitialized = false;
|
|
|
|
if (sInitialized)
|
|
|
|
return;
|
|
|
|
|
|
|
|
sInitialized = true;
|
|
|
|
if (NS_IsMainThread()) {
|
|
|
|
ReadAxisPrefs();
|
|
|
|
} else {
|
|
|
|
// We have to dispatch an event to the main thread to read the pref.
|
|
|
|
NS_DispatchToMainThread(new ReadAxisPref());
|
|
|
|
}
|
|
|
|
}
|
2012-07-19 23:48:25 -07:00
|
|
|
|
|
|
|
Axis::Axis(AsyncPanZoomController* aAsyncPanZoomController)
|
2013-04-09 19:17:54 -07:00
|
|
|
: mPos(0),
|
2012-07-19 23:48:25 -07:00
|
|
|
mVelocity(0.0f),
|
2012-08-13 21:08:38 -07:00
|
|
|
mAcceleration(0),
|
2012-10-24 01:37:53 -07:00
|
|
|
mAsyncPanZoomController(aAsyncPanZoomController)
|
2012-07-19 23:48:25 -07:00
|
|
|
{
|
2013-01-09 22:13:24 -08:00
|
|
|
InitAxisPrefs();
|
2012-07-19 23:48:25 -07:00
|
|
|
}
|
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
void Axis::UpdateWithTouchAtDevicePoint(int32_t aPos, const TimeDuration& aTimeDelta) {
|
2012-07-22 18:43:37 -07:00
|
|
|
float newVelocity = (mPos - aPos) / aTimeDelta.ToMilliseconds();
|
2012-07-19 23:48:25 -07:00
|
|
|
|
2013-01-09 22:11:25 -08:00
|
|
|
bool curVelocityBelowThreshold = fabsf(newVelocity) < gVelocityThreshold;
|
2012-08-13 21:08:38 -07:00
|
|
|
bool directionChange = (mVelocity > 0) != (newVelocity > 0);
|
|
|
|
|
|
|
|
// If we've changed directions, or the current velocity threshold, stop any
|
|
|
|
// acceleration we've accumulated.
|
|
|
|
if (directionChange || curVelocityBelowThreshold) {
|
|
|
|
mAcceleration = 0;
|
|
|
|
}
|
2012-07-19 23:48:25 -07:00
|
|
|
|
|
|
|
mVelocity = newVelocity;
|
|
|
|
mPos = aPos;
|
2013-02-20 14:59:15 -08:00
|
|
|
|
|
|
|
// Keep last gMaxVelocityQueueSize or less velocities in the queue.
|
|
|
|
mVelocityQueue.AppendElement(mVelocity);
|
|
|
|
if (mVelocityQueue.Length() > gMaxVelocityQueueSize) {
|
|
|
|
mVelocityQueue.RemoveElementAt(0);
|
|
|
|
}
|
2012-07-19 23:48:25 -07:00
|
|
|
}
|
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
void Axis::StartTouch(int32_t aPos) {
|
2012-07-19 23:48:25 -07:00
|
|
|
mStartPos = aPos;
|
|
|
|
mPos = aPos;
|
|
|
|
}
|
|
|
|
|
2012-08-21 21:37:15 -07:00
|
|
|
float Axis::GetDisplacementForDuration(float aScale, const TimeDuration& aDelta) {
|
2013-01-09 22:11:25 -08:00
|
|
|
if (fabsf(mVelocity) < gVelocityThreshold) {
|
2012-09-28 21:02:45 -07:00
|
|
|
mAcceleration = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
float accelerationFactor = GetAccelerationFactor();
|
|
|
|
float displacement = mVelocity * aScale * aDelta.ToMilliseconds() * accelerationFactor;
|
2012-07-19 23:48:25 -07:00
|
|
|
// If this displacement will cause an overscroll, throttle it. Can potentially
|
|
|
|
// bring it to 0 even if the velocity is high.
|
|
|
|
if (DisplacementWillOverscroll(displacement) != OVERSCROLL_NONE) {
|
2012-08-13 21:08:38 -07:00
|
|
|
// No need to have a velocity along this axis anymore; it won't take us
|
|
|
|
// anywhere, so we're just spinning needlessly.
|
|
|
|
mVelocity = 0.0f;
|
2012-09-28 21:02:45 -07:00
|
|
|
mAcceleration = 0;
|
2012-07-19 23:48:25 -07:00
|
|
|
displacement -= DisplacementWillOverscrollAmount(displacement);
|
|
|
|
}
|
|
|
|
return displacement;
|
|
|
|
}
|
|
|
|
|
|
|
|
float Axis::PanDistance() {
|
|
|
|
return fabsf(mPos - mStartPos);
|
|
|
|
}
|
|
|
|
|
2012-08-13 21:08:38 -07:00
|
|
|
void Axis::EndTouch() {
|
2012-08-13 21:08:38 -07:00
|
|
|
mAcceleration++;
|
2013-02-20 14:59:15 -08:00
|
|
|
|
|
|
|
// Calculate the mean velocity and empty the queue.
|
|
|
|
int count = mVelocityQueue.Length();
|
|
|
|
if (count) {
|
|
|
|
mVelocity = 0;
|
|
|
|
while (!mVelocityQueue.IsEmpty()) {
|
|
|
|
mVelocity += mVelocityQueue[0];
|
|
|
|
mVelocityQueue.RemoveElementAt(0);
|
|
|
|
}
|
|
|
|
mVelocity /= count;
|
|
|
|
}
|
2012-08-13 21:08:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void Axis::CancelTouch() {
|
2012-07-19 23:48:25 -07:00
|
|
|
mVelocity = 0.0f;
|
2012-08-13 21:08:38 -07:00
|
|
|
mAcceleration = 0;
|
2013-02-20 14:59:15 -08:00
|
|
|
while (!mVelocityQueue.IsEmpty()) {
|
|
|
|
mVelocityQueue.RemoveElementAt(0);
|
|
|
|
}
|
2012-07-19 23:48:25 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Axis::FlingApplyFrictionOrCancel(const TimeDuration& aDelta) {
|
2013-01-09 22:11:25 -08:00
|
|
|
if (fabsf(mVelocity) <= gFlingStoppedThreshold) {
|
2012-07-19 23:48:25 -07:00
|
|
|
// If the velocity is very low, just set it to 0 and stop the fling,
|
|
|
|
// otherwise we'll just asymptotically approach 0 and the user won't
|
|
|
|
// actually see any changes.
|
|
|
|
mVelocity = 0.0f;
|
|
|
|
return false;
|
|
|
|
} else {
|
2013-01-14 13:02:41 -08:00
|
|
|
mVelocity *= pow(1.0f - gFlingFriction, float(aDelta.ToMilliseconds()));
|
2012-07-19 23:48:25 -07:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
Axis::Overscroll Axis::GetOverscroll() {
|
2012-09-28 19:16:34 -07:00
|
|
|
// If the current pan takes the window to the left of or above the current
|
2012-07-19 23:48:25 -07:00
|
|
|
// page rect.
|
|
|
|
bool minus = GetOrigin() < GetPageStart();
|
2012-09-28 19:16:34 -07:00
|
|
|
// If the current pan takes the window to the right of or below the current
|
2012-07-19 23:48:25 -07:00
|
|
|
// page rect.
|
2012-09-28 19:16:34 -07:00
|
|
|
bool plus = GetCompositionEnd() > GetPageEnd();
|
2012-07-19 23:48:25 -07:00
|
|
|
if (minus && plus) {
|
|
|
|
return OVERSCROLL_BOTH;
|
|
|
|
}
|
|
|
|
if (minus) {
|
|
|
|
return OVERSCROLL_MINUS;
|
|
|
|
}
|
|
|
|
if (plus) {
|
|
|
|
return OVERSCROLL_PLUS;
|
|
|
|
}
|
|
|
|
return OVERSCROLL_NONE;
|
|
|
|
}
|
|
|
|
|
2012-08-21 21:37:15 -07:00
|
|
|
float Axis::GetExcess() {
|
2012-07-19 23:48:25 -07:00
|
|
|
switch (GetOverscroll()) {
|
|
|
|
case OVERSCROLL_MINUS: return GetOrigin() - GetPageStart();
|
2012-09-28 19:16:34 -07:00
|
|
|
case OVERSCROLL_PLUS: return GetCompositionEnd() - GetPageEnd();
|
|
|
|
case OVERSCROLL_BOTH: return (GetCompositionEnd() - GetPageEnd()) +
|
|
|
|
(GetPageStart() - GetOrigin());
|
2012-07-19 23:48:25 -07:00
|
|
|
default: return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-02 06:24:16 -07:00
|
|
|
Axis::Overscroll Axis::DisplacementWillOverscroll(float aDisplacement) {
|
2012-09-28 19:16:34 -07:00
|
|
|
// If the current pan plus a displacement takes the window to the left of or
|
2012-07-19 23:48:25 -07:00
|
|
|
// above the current page rect.
|
|
|
|
bool minus = GetOrigin() + aDisplacement < GetPageStart();
|
2012-09-28 19:16:34 -07:00
|
|
|
// If the current pan plus a displacement takes the window to the right of or
|
2012-07-19 23:48:25 -07:00
|
|
|
// below the current page rect.
|
2012-09-28 19:16:34 -07:00
|
|
|
bool plus = GetCompositionEnd() + aDisplacement > GetPageEnd();
|
2012-07-19 23:48:25 -07:00
|
|
|
if (minus && plus) {
|
|
|
|
return OVERSCROLL_BOTH;
|
|
|
|
}
|
|
|
|
if (minus) {
|
|
|
|
return OVERSCROLL_MINUS;
|
|
|
|
}
|
|
|
|
if (plus) {
|
|
|
|
return OVERSCROLL_PLUS;
|
|
|
|
}
|
|
|
|
return OVERSCROLL_NONE;
|
|
|
|
}
|
|
|
|
|
2013-05-02 06:24:16 -07:00
|
|
|
float Axis::DisplacementWillOverscrollAmount(float aDisplacement) {
|
2012-07-19 23:48:25 -07:00
|
|
|
switch (DisplacementWillOverscroll(aDisplacement)) {
|
|
|
|
case OVERSCROLL_MINUS: return (GetOrigin() + aDisplacement) - GetPageStart();
|
2012-09-28 19:16:34 -07:00
|
|
|
case OVERSCROLL_PLUS: return (GetCompositionEnd() + aDisplacement) - GetPageEnd();
|
2012-07-19 23:48:25 -07:00
|
|
|
// Don't handle overscrolled in both directions; a displacement can't cause
|
|
|
|
// this, it must have already been zoomed out too far.
|
|
|
|
default: return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-11 15:13:11 -07:00
|
|
|
Axis::Overscroll Axis::ScaleWillOverscroll(float aScale, float aFocus) {
|
2012-08-21 21:37:15 -07:00
|
|
|
float originAfterScale = (GetOrigin() + aFocus) * aScale - aFocus;
|
2012-07-19 23:48:25 -07:00
|
|
|
|
|
|
|
bool both = ScaleWillOverscrollBothSides(aScale);
|
2012-08-21 21:37:15 -07:00
|
|
|
bool minus = originAfterScale < GetPageStart() * aScale;
|
2012-09-28 19:16:34 -07:00
|
|
|
bool plus = (originAfterScale + GetCompositionLength()) > GetPageEnd() * aScale;
|
2012-07-19 23:48:25 -07:00
|
|
|
|
|
|
|
if ((minus && plus) || both) {
|
|
|
|
return OVERSCROLL_BOTH;
|
|
|
|
}
|
|
|
|
if (minus) {
|
|
|
|
return OVERSCROLL_MINUS;
|
|
|
|
}
|
|
|
|
if (plus) {
|
|
|
|
return OVERSCROLL_PLUS;
|
|
|
|
}
|
|
|
|
return OVERSCROLL_NONE;
|
|
|
|
}
|
|
|
|
|
2013-06-11 15:13:11 -07:00
|
|
|
float Axis::ScaleWillOverscrollAmount(float aScale, float aFocus) {
|
2012-08-21 21:37:15 -07:00
|
|
|
float originAfterScale = (GetOrigin() + aFocus) * aScale - aFocus;
|
2012-07-19 23:48:25 -07:00
|
|
|
switch (ScaleWillOverscroll(aScale, aFocus)) {
|
2012-08-21 21:37:15 -07:00
|
|
|
case OVERSCROLL_MINUS: return originAfterScale - GetPageStart() * aScale;
|
2012-09-28 19:16:34 -07:00
|
|
|
case OVERSCROLL_PLUS: return (originAfterScale + GetCompositionLength()) -
|
|
|
|
NS_lround(GetPageEnd() * aScale);
|
2012-07-19 23:48:25 -07:00
|
|
|
// Don't handle OVERSCROLL_BOTH. Client code is expected to deal with it.
|
|
|
|
default: return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
float Axis::GetVelocity() {
|
|
|
|
return mVelocity;
|
|
|
|
}
|
|
|
|
|
2012-09-28 21:02:45 -07:00
|
|
|
float Axis::GetAccelerationFactor() {
|
2013-01-15 04:22:03 -08:00
|
|
|
return powf(gAccelerationMultiplier, std::max(0, (mAcceleration - 4) * 3));
|
2012-09-28 21:02:45 -07:00
|
|
|
}
|
|
|
|
|
2012-09-28 19:16:34 -07:00
|
|
|
float Axis::GetCompositionEnd() {
|
|
|
|
return GetOrigin() + GetCompositionLength();
|
2012-07-19 23:48:25 -07:00
|
|
|
}
|
|
|
|
|
2012-08-21 21:37:15 -07:00
|
|
|
float Axis::GetPageEnd() {
|
2012-07-19 23:48:25 -07:00
|
|
|
return GetPageStart() + GetPageLength();
|
|
|
|
}
|
|
|
|
|
2012-08-21 21:37:15 -07:00
|
|
|
float Axis::GetOrigin() {
|
2013-05-30 18:30:13 -07:00
|
|
|
CSSPoint origin = mAsyncPanZoomController->GetFrameMetrics().mScrollOffset;
|
2012-07-19 23:48:25 -07:00
|
|
|
return GetPointOffset(origin);
|
|
|
|
}
|
|
|
|
|
2012-09-28 19:16:34 -07:00
|
|
|
float Axis::GetCompositionLength() {
|
2012-10-11 22:46:24 -07:00
|
|
|
const FrameMetrics& metrics = mAsyncPanZoomController->GetFrameMetrics();
|
2013-06-26 06:54:49 -07:00
|
|
|
CSSRect cssCompositedRect = metrics.CalculateCompositedRectInCssPixels();
|
2012-10-11 22:46:24 -07:00
|
|
|
return GetRectLength(cssCompositedRect);
|
2012-07-19 23:48:25 -07:00
|
|
|
}
|
|
|
|
|
2012-08-21 21:37:15 -07:00
|
|
|
float Axis::GetPageStart() {
|
2013-06-03 06:52:44 -07:00
|
|
|
CSSRect pageRect = mAsyncPanZoomController->GetFrameMetrics().mScrollableRect;
|
2012-07-19 23:48:25 -07:00
|
|
|
return GetRectOffset(pageRect);
|
|
|
|
}
|
|
|
|
|
2012-08-21 21:37:15 -07:00
|
|
|
float Axis::GetPageLength() {
|
2013-06-03 06:52:44 -07:00
|
|
|
CSSRect pageRect = mAsyncPanZoomController->GetFrameMetrics().mScrollableRect;
|
2012-07-19 23:48:25 -07:00
|
|
|
return GetRectLength(pageRect);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Axis::ScaleWillOverscrollBothSides(float aScale) {
|
|
|
|
const FrameMetrics& metrics = mAsyncPanZoomController->GetFrameMetrics();
|
|
|
|
|
2013-06-03 06:52:44 -07:00
|
|
|
CSSRect cssContentRect = metrics.mScrollableRect;
|
2012-07-19 23:48:25 -07:00
|
|
|
|
2013-07-25 10:15:10 -07:00
|
|
|
CSSToScreenScale scale(metrics.CalculateResolution().scale * aScale);
|
2013-06-14 13:11:44 -07:00
|
|
|
CSSIntRect cssCompositionBounds = RoundedIn(metrics.mCompositionBounds / scale);
|
2012-07-19 23:48:25 -07:00
|
|
|
|
2013-06-03 06:52:44 -07:00
|
|
|
return GetRectLength(cssContentRect) < GetRectLength(CSSRect(cssCompositionBounds));
|
2012-07-19 23:48:25 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
AxisX::AxisX(AsyncPanZoomController* aAsyncPanZoomController)
|
|
|
|
: Axis(aAsyncPanZoomController)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-05-30 18:30:13 -07:00
|
|
|
float AxisX::GetPointOffset(const CSSPoint& aPoint)
|
2012-07-19 23:48:25 -07:00
|
|
|
{
|
|
|
|
return aPoint.x;
|
|
|
|
}
|
|
|
|
|
2013-06-03 06:52:44 -07:00
|
|
|
float AxisX::GetRectLength(const CSSRect& aRect)
|
2012-07-19 23:48:25 -07:00
|
|
|
{
|
2012-08-21 21:37:15 -07:00
|
|
|
return aRect.width;
|
2012-07-19 23:48:25 -07:00
|
|
|
}
|
|
|
|
|
2013-06-03 06:52:44 -07:00
|
|
|
float AxisX::GetRectOffset(const CSSRect& aRect)
|
2012-07-19 23:48:25 -07:00
|
|
|
{
|
2012-08-21 21:37:15 -07:00
|
|
|
return aRect.x;
|
2012-07-19 23:48:25 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
AxisY::AxisY(AsyncPanZoomController* aAsyncPanZoomController)
|
|
|
|
: Axis(aAsyncPanZoomController)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-05-30 18:30:13 -07:00
|
|
|
float AxisY::GetPointOffset(const CSSPoint& aPoint)
|
2012-07-19 23:48:25 -07:00
|
|
|
{
|
|
|
|
return aPoint.y;
|
|
|
|
}
|
|
|
|
|
2013-06-03 06:52:44 -07:00
|
|
|
float AxisY::GetRectLength(const CSSRect& aRect)
|
2012-07-19 23:48:25 -07:00
|
|
|
{
|
2012-08-21 21:37:15 -07:00
|
|
|
return aRect.height;
|
2012-07-19 23:48:25 -07:00
|
|
|
}
|
|
|
|
|
2013-06-03 06:52:44 -07:00
|
|
|
float AxisY::GetRectOffset(const CSSRect& aRect)
|
2012-07-19 23:48:25 -07:00
|
|
|
{
|
2012-08-21 21:37:15 -07:00
|
|
|
return aRect.y;
|
2012-07-19 23:48:25 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|