本文整理匯總了C++中GetPageEnd函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetPageEnd函數的具體用法?C++ GetPageEnd怎麽用?C++ GetPageEnd使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GetPageEnd函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: MOZ_ASSERT
void Axis::OverscrollBy(ParentLayerCoord aOverscroll) {
MOZ_ASSERT(CanScroll());
StopSamplingOverscrollAnimation();
aOverscroll = ApplyResistance(aOverscroll);
if (aOverscroll > 0) {
#ifdef DEBUG
if (!FuzzyEqualsCoordinate(GetCompositionEnd().value, GetPageEnd().value)) {
nsPrintfCString message("composition end (%f) is not equal (within error) to page end (%f)\n",
GetCompositionEnd().value, GetPageEnd().value);
NS_ASSERTION(false, message.get());
MOZ_CRASH();
}
#endif
MOZ_ASSERT(mOverscroll >= 0);
} else if (aOverscroll < 0) {
#ifdef DEBUG
if (!FuzzyEqualsCoordinate(GetOrigin().value, GetPageStart().value)) {
nsPrintfCString message("composition origin (%f) is not equal (within error) to page origin (%f)\n",
GetOrigin().value, GetPageStart().value);
NS_ASSERTION(false, message.get());
MOZ_CRASH();
}
#endif
MOZ_ASSERT(mOverscroll <= 0);
}
mOverscroll += aOverscroll;
}
示例2: MOZ_ASSERT
void Axis::OverscrollBy(CSSCoord aOverscroll) {
MOZ_ASSERT(CanScroll());
aOverscroll = ApplyResistance(aOverscroll);
if (aOverscroll > 0) {
#ifdef DEBUG
if (!FuzzyEqualsAdditive(GetCompositionEnd().value, GetPageEnd().value, COORDINATE_EPSILON)) {
nsPrintfCString message("composition end (%f) is not within COORDINATE_EPISLON of page end (%f)\n",
GetCompositionEnd().value, GetPageEnd().value);
NS_ASSERTION(false, message.get());
MOZ_CRASH();
}
#endif
MOZ_ASSERT(mOverscroll >= 0);
} else if (aOverscroll < 0) {
#ifdef DEBUG
if (!FuzzyEqualsAdditive(GetOrigin().value, GetPageStart().value, COORDINATE_EPSILON)) {
nsPrintfCString message("composition origin (%f) is not within COORDINATE_EPISLON of page origin (%f)\n",
GetOrigin().value, GetPageStart().value);
NS_ASSERTION(false, message.get());
MOZ_CRASH();
}
#endif
MOZ_ASSERT(mOverscroll <= 0);
}
mOverscroll += aOverscroll;
}
示例3: switch
float Axis::GetExcess() {
switch (GetOverscroll()) {
case OVERSCROLL_MINUS: return GetOrigin() - GetPageStart();
case OVERSCROLL_PLUS: return GetCompositionEnd() - GetPageEnd();
case OVERSCROLL_BOTH: return (GetCompositionEnd() - GetPageEnd()) +
(GetPageStart() - GetOrigin());
default: return 0;
}
}
示例4: ScaleWillOverscrollBothSides
float Axis::ScaleWillOverscrollAmount(float aScale, float aFocus) {
float originAfterScale = (GetOrigin() + aFocus) - (aFocus / aScale);
bool both = ScaleWillOverscrollBothSides(aScale);
bool minus = originAfterScale < GetPageStart();
bool plus = (originAfterScale + (GetCompositionLength() / aScale)) > GetPageEnd();
if ((minus && plus) || both) {
// If we ever reach here it's a bug in the client code.
MOZ_ASSERT(false, "In an OVERSCROLL_BOTH condition in ScaleWillOverscrollAmount");
return 0;
}
if (minus) {
return originAfterScale - GetPageStart();
}
if (plus) {
return originAfterScale + (GetCompositionLength() / aScale) - GetPageEnd();
}
return 0;
}
示例5: MOZ_ASSERT
void Axis::OverscrollBy(CSSCoord aOverscroll) {
MOZ_ASSERT(CanScroll());
aOverscroll = ApplyResistance(aOverscroll);
if (aOverscroll > 0) {
MOZ_ASSERT(FuzzyEqualsAdditive(GetCompositionEnd().value, GetPageEnd().value, COORDINATE_EPSILON));
MOZ_ASSERT(mOverscroll >= 0);
} else if (aOverscroll < 0) {
MOZ_ASSERT(FuzzyEqualsAdditive(GetOrigin().value, GetPageStart().value, COORDINATE_EPSILON));
MOZ_ASSERT(mOverscroll <= 0);
}
mOverscroll += aOverscroll;
}
示例6: ScaleWillOverscrollBothSides
Axis::Overscroll Axis::ScaleWillOverscroll(float aScale, int32_t aFocus) {
float originAfterScale = (GetOrigin() + aFocus) * aScale - aFocus;
bool both = ScaleWillOverscrollBothSides(aScale);
bool minus = originAfterScale < GetPageStart() * aScale;
bool plus = (originAfterScale + GetCompositionLength()) > GetPageEnd() * aScale;
if ((minus && plus) || both) {
return OVERSCROLL_BOTH;
}
if (minus) {
return OVERSCROLL_MINUS;
}
if (plus) {
return OVERSCROLL_PLUS;
}
return OVERSCROLL_NONE;
}
示例7: GetOrigin
Axis::Overscroll Axis::DisplacementWillOverscroll(int32_t aDisplacement) {
// If the current pan plus a displacement takes the window to the left of or
// above the current page rect.
bool minus = GetOrigin() + aDisplacement < GetPageStart();
// If the current pan plus a displacement takes the window to the right of or
// below the current page rect.
bool plus = GetCompositionEnd() + aDisplacement > GetPageEnd();
if (minus && plus) {
return OVERSCROLL_BOTH;
}
if (minus) {
return OVERSCROLL_MINUS;
}
if (plus) {
return OVERSCROLL_PLUS;
}
return OVERSCROLL_NONE;
}
示例8: GetOrigin
bool Axis::HasRoomToPan() const {
return GetOrigin() > GetPageStart()
|| GetCompositionEnd() < GetPageEnd();
}