void ColorTableCreator::undo() { if (brushStrokes.empty()) return; BrushStroke reverseStroke = brushStrokes.back().invert(); paintStroke(reverseStroke); brushStrokes.pop_back(); }
void xsCanvasContext::stroke() { xsGraphics *gc = xsGetSystemGc(); paintStroke(gc); xsRect clientRect; if(xsGetClientRect(&clientRect)) { xsFlushScreen(clientRect.left, clientRect.top, clientRect.right, clientRect.bottom); } }
void EraserTool::mouseReleaseEvent(QMouseEvent *event, PaintCanvas *canvas) { if(!canvas->isPainting()) return; if(event->button() == Qt::LeftButton) { mEndPoint = event->posF(); strokeEnd(); canvas->setEditImage(mImageCopy); QImage strokeImage = paintStroke(canvas); canvas->setIsPainting(false); canvas->setFrameImage(strokeImage); } }
void ColorTableCreator::canvasClicked(int x, int y, int brushSize, bool leftClick) { BrushStroke brushStroke(x, y, (image::Color::ColorID) currentColor, brushSize, leftClick); brushStrokes.push_back(brushStroke); paintStroke(brushStroke); }