Код отрисовки линии ниже if (drawing) { if (tool == 1) { currentLayer->drawLine(Pens::Black, xPrev, yPrev, x, y); pictureBox1->Invalidate(); xPrev = x; yPrev = y; } } Code if (drawing) { if (tool == 1) { currentLayer->drawLine(Pens::Black, xPrev, yPrev, x, y); pictureBox1->Invalidate(); xPrev = x; yPrev = y; } }