本文整理汇总了C++中MediaValues::viewportHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ MediaValues::viewportHeight方法的具体用法?C++ MediaValues::viewportHeight怎么用?C++ MediaValues::viewportHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaValues
的用法示例。
在下文中一共展示了MediaValues::viewportHeight方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: heightMediaFeatureEval
static bool heightMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix op, const MediaValues& mediaValues)
{
int height = mediaValues.viewportHeight();
if (value.isValid())
return computeLengthAndCompare(value, op, mediaValues, height);
return height;
}
示例2: aspectRatioMediaFeatureEval
static bool aspectRatioMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix op, const MediaValues& mediaValues)
{
if (value.isValid())
return compareAspectRatioValue(value, mediaValues.viewportWidth(), mediaValues.viewportHeight(), op);
// ({,min-,max-}aspect-ratio)
// assume if we have a device, its aspect ratio is non-zero.
return true;
}
示例3: heightMediaFeatureEval
static bool heightMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix op, const MediaValues& mediaValues)
{
int height = mediaValues.viewportHeight();
if (value.isValid()) {
int length;
return computeLength(value, mediaValues, length) && compareValue(height, length, op);
}
return height;
}
示例4: orientationMediaFeatureEval
static bool orientationMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix, const MediaValues& mediaValues)
{
int width = mediaValues.viewportWidth();
int height = mediaValues.viewportHeight();
if (value.isID) {
if (width > height) // Square viewport is portrait.
return CSSValueLandscape == value.id;
return CSSValuePortrait == value.id;
}
// Expression (orientation) evaluates to true if width and height >= 0.
return height >= 0 && width >= 0;
}