Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

  1. void qtDrawBorderPixmap(QPainter *painter, const QRectF ⌖, const QPixmap &pixmap;, const QRectF &source;, const QtPixmapBorders &borders;)
  2. {
  3.     // source center
  4.     const qreal sourceTop = source.top();
  5.     const qreal sourceLeft = source.left();
  6.     const qreal sourceCenterTop = sourceTop + borders.sourceTopBorder;
  7.     const qreal sourceCenterLeft = sourceLeft + borders.sourceLeftBorder;
  8.     const qreal sourceCenterRight = source.right() - borders.sourceRightBorder;
  9.     const qreal sourceCenterBottom = source.bottom() - borders.sourceBottomBorder;
  10.     const qreal sourceCenterWidth = sourceCenterRight - borders.sourceLeftBorder;
  11.     const qreal sourceCenterHeight = sourceCenterBottom - borders.sourceTopBorder;
  12.     // target borders
  13.     const qreal targetTopBorder = (borders.targetTopBorder == -1 ? borders.sourceTopBorder : borders.targetTopBorder);
  14.     const qreal targetLeftBorder = (borders.targetLeftBorder == -1 ? borders.sourceLeftBorder : borders.targetLeftBorder);
  15.     const qreal targetBottomBorder = (borders.targetBottomBorder == -1 ? borders.sourceBottomBorder : borders.targetBottomBorder);
  16.     const qreal targetRightBorder = (borders.targetRightBorder == -1 ? borders.sourceRightBorder : borders.targetRightBorder);
  17.     // target center
  18.     const qreal targetTop = target.top();
  19.     const qreal targetLeft = target.left();
  20.     const qreal targetCenterTop = targetTop + targetTopBorder;
  21.     const qreal targetCenterLeft = targetLeft + targetLeftBorder;
  22.     const qreal targetCenterRight = target.right() - targetRightBorder;
  23.     const qreal targetCenterBottom = target.bottom() - targetBottomBorder;
  24.     const qreal targetCenterWidth = targetCenterRight - targetCenterLeft;
  25.     const qreal targetCenterHeight = targetCenterBottom - targetCenterTop;