69 Q_UNUSED(currentNode);
73 bool eventIgnored =
true;
80 newHorizontalOffset = (newHorizontalOffset / (float)option.
grid_width);
81 newVerticalOffset = (newVerticalOffset / (float)option.
grid_height);
83 if (newHorizontalOffset > 0.5) {
84 newHorizontalOffset = newHorizontalOffset - 1;
86 if (newVerticalOffset > 0.5) {
87 newVerticalOffset = newVerticalOffset -1;
109 shapeOption.
read(
this);
113 QRectF rc(0, 0, sizex, sizey);
114 rc.translate(-rc.center());
120 QPainterPath tiltLine =
makeTiltIndicator(info, QPointF(0.0, 0.0), sizex * 0.5, 3.0);
121 path.addPath(
outlineFetcher()->fetchOutline(info,
this, tiltLine, mode, alignForZoom, 1.0, 0.0,
true, 0, 0));
145 qreal posX = info.
pos().x() - (gridWidth/2) + (cellWidth/2) - horizontalOffset;
146 qreal posY = info.
pos().y() - (gridHeight/2) + (cellHeight/2) - verticalOffset;
149 posX = posX - std::fmod(posX, cellWidth) + horizontalOffset;
150 posY = posY - std::fmod(posY, cellHeight) + verticalOffset;
151 const QRectF dabRect(posX , posY , cellWidth, cellHeight);
153 divide = qMax(1, divide);
154 const qreal yStep = cellHeight / (qreal)divide;
155 const qreal xStep = cellWidth / (qreal)divide;
158 QPainterPath cellPath;
159 for (
int y = 0; y < (gridHeight)/yStep; y++) {
160 for (
int x = 0; x < (gridWidth)/xStep; x++) {
161 tile = QRectF(dabRect.x() + x * xStep, dabRect.y() + y * yStep, xStep, yStep);
162 switch (shapeOption.
shape) {
164 cellPath.addEllipse(tile);
168 cellPath.addRect(tile);
172 cellPath.moveTo(tile.topRight());
173 cellPath.lineTo(tile.bottomLeft());
177 cellPath.moveTo(tile.topRight());
178 cellPath.lineTo(tile.bottomLeft());
182 cellPath.moveTo(tile.topRight());
183 cellPath.lineTo(tile.bottomLeft());
KisOptimizedBrushOutline fetchOutline(const KisPaintInformation &info, const KisPaintOpSettingsSP settings, const KisOptimizedBrushOutline &originalOutline, const KisPaintOpSettings::OutlineMode &mode, qreal alignForZoom, qreal additionalScale=1.0, qreal additionalRotation=0.0, bool tilt=false, qreal tiltcenterx=1.0, qreal tiltcentery=1.0) const