本文整理汇总了C++中CachedImage::pixmap_size方法的典型用法代码示例。如果您正苦于以下问题:C++ CachedImage::pixmap_size方法的具体用法?C++ CachedImage::pixmap_size怎么用?C++ CachedImage::pixmap_size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CachedImage
的用法示例。
在下文中一共展示了CachedImage::pixmap_size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paintBackground
void InlineFlowBox::paintBackground(QPainter* p, const QColor& c, const BackgroundLayer* bgLayer,
int my, int mh, int _tx, int _ty, int w, int h)
{
CachedImage* bg = bgLayer->backgroundImage();
bool hasBackgroundImage = bg && (bg->pixmap_size() == bg->valid_rect().size()) &&
!bg->isTransparent() && !bg->isErrorImage();
if (!hasBackgroundImage || (!prevLineBox() && !nextLineBox()) || !parent())
object()->paintBackgroundExtended(p, c, bgLayer, my, mh, _tx, _ty, w, h, borderLeft(), borderRight(), paddingLeft(), paddingRight());
else {
// We have a background image that spans multiple lines.
// We need to adjust _tx and _ty by the width of all previous lines.
// Think of background painting on inlines as though you had one long line, a single continuous
// strip. Even though that strip has been broken up across multiple lines, you still paint it
// as though you had one single line. This means each line has to pick up the background where
// the previous line left off.
// FIXME: What the heck do we do with RTL here? The math we're using is obviously not right,
// but it isn't even clear how this should work at all.
int xOffsetOnLine = 0;
for (InlineRunBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
xOffsetOnLine += curr->width();
int startX = _tx - xOffsetOnLine;
int totalWidth = xOffsetOnLine;
for (InlineRunBox* curr = this; curr; curr = curr->nextLineBox())
totalWidth += curr->width();
p->save();
p->setClipRect(QRect(_tx, _ty, width(), height()), QPainter::CoordPainter);
object()->paintBackgroundExtended(p, c, bgLayer, my, mh, startX, _ty,
totalWidth, h, borderLeft(), borderRight(), paddingLeft(), paddingRight());
p->restore();
}
}