Changeset View
Changeset View
Standalone View
Standalone View
scene.cpp
Show First 20 Lines • Show All 874 Lines • ▼ Show 20 Line(s) | 842 | { | |||
---|---|---|---|---|---|
875 | cached_quad_list.reset(new WindowQuadList(ret)); | 875 | cached_quad_list.reset(new WindowQuadList(ret)); | ||
876 | return ret; | 876 | return ret; | ||
877 | } | 877 | } | ||
878 | 878 | | |||
879 | WindowQuadList Scene::Window::makeDecorationQuads(const QRect *rects, const QRegion ®ion, qreal textureScale) const | 879 | WindowQuadList Scene::Window::makeDecorationQuads(const QRect *rects, const QRegion ®ion, qreal textureScale) const | ||
880 | { | 880 | { | ||
881 | WindowQuadList list; | 881 | WindowQuadList list; | ||
882 | 882 | | |||
883 | const int padding = 1; | ||||
884 | | ||||
885 | const QPoint topSpritePosition(padding, padding); | ||||
886 | const QPoint bottomSpritePosition(padding, topSpritePosition.y() + rects[1].height() + 2 * padding); | ||||
887 | const QPoint leftSpritePosition(bottomSpritePosition.y() + rects[3].height() + 2 * padding, padding); | ||||
888 | const QPoint rightSpritePosition(leftSpritePosition.x() + rects[0].width() + 2 * padding, padding); | ||||
889 | | ||||
883 | const QPoint offsets[4] = { | 890 | const QPoint offsets[4] = { | ||
884 | QPoint(-rects[0].x() + rects[1].height() + rects[3].height() + 2, -rects[0].y()), // Left | 891 | QPoint(-rects[0].x(), -rects[0].y()) + leftSpritePosition, | ||
885 | QPoint(-rects[1].x(), -rects[1].y()), // Top | 892 | QPoint(-rects[1].x(), -rects[1].y()) + topSpritePosition, | ||
886 | QPoint(-rects[2].x() + rects[1].height() + rects[3].height() + rects[0].width() + 3, -rects[2].y()), // Right | 893 | QPoint(-rects[2].x(), -rects[2].y()) + rightSpritePosition, | ||
887 | QPoint(-rects[3].x(), -rects[3].y() + rects[1].height() + 1) // Bottom | 894 | QPoint(-rects[3].x(), -rects[3].y()) + bottomSpritePosition, | ||
888 | }; | 895 | }; | ||
fredrik: That's the reason for the +1, +2 and +3 in the vertical positions here. | |||||
889 | 896 | | |||
890 | const Qt::Orientation orientations[4] = { | 897 | const Qt::Orientation orientations[4] = { | ||
891 | Qt::Vertical, // Left | 898 | Qt::Vertical, // Left | ||
892 | Qt::Horizontal, // Top | 899 | Qt::Horizontal, // Top | ||
893 | Qt::Vertical, // Right | 900 | Qt::Vertical, // Right | ||
894 | Qt::Horizontal, // Bottom | 901 | Qt::Horizontal, // Bottom | ||
895 | }; | 902 | }; | ||
896 | 903 | | |||
▲ Show 20 Lines • Show All 268 Lines • Show Last 20 Lines |
That's the reason for the +1, +2 and +3 in the vertical positions here.