7#ifndef __KIS_WRAPPED_RECT_H
8#define __KIS_WRAPPED_RECT_H
58 if (rc.bottom() >
wrapRect.bottom()) {
97 result.append(rc.topLeft());
109 QRect newRect(x, y, w, h);
112 result.append(QPoint(x, y));
117 result.append(QPoint(x -
wrapRect.width(), y));
122 result.append(QPoint(x, y -
wrapRect.height()));
136 const QRect &limitRect,
153 Q_FOREACH (
const QRect &
rect, wrappedRect) {
154 if (
rect.isEmpty())
continue;
156 for (
int y = firstRow; y <= lastRow; y++) {
157 for (
int x = firstCol; x <= lastCol; x++) {
159 const QRect currentRect =
160 rect.translated(offset +
wrapRect.topLeft()) & limitRect;
162 if (!currentRect.isEmpty()) {
163 result << currentRect;
197 QRect newRect(x, y, w, h);
213 int size = this->size();
216 Q_ASSERT(size == 1 || size == 4);
static int yToWrappedY(int y, const QRect &wrapRect, WrapAroundAxis wrapAxis)
static bool wrapRectContains(const QRect &rc, const QRect &wrapRect, WrapAroundAxis wrapAxis)
static QRect clipToWrapRect(QRect rc, const QRect &wrapRect, WrapAroundAxis wrapAxis)
QRect originalRect() const
static QVector< QPoint > normalizationOriginsForRect(const QRect &rc, const QRect &wrapRect, WrapAroundAxis wrapAxis)
QRect bottomRight() const
static bool wrapRectContains(QPoint pt, const QRect &wrapRect, WrapAroundAxis wrapAxis)
static QPoint ptToWrappedPt(QPoint pt, const QRect &wrapRect, WrapAroundAxis wrapAxis)
KisWrappedRect(const QRect &rc, const QRect &wrapRect, WrapAroundAxis wrapAxis)
static QVector< QRect > multiplyWrappedRect(const QRect &rc, const QRect &wrapRect, const QRect &limitRect, WrapAroundAxis wrapAxis)
static int xToWrappedX(int x, const QRect &wrapRect, WrapAroundAxis wrapAxis)