Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
.
[graphlib.git] / DrawingWindow.cpp
index dd91013..4cbccc3 100644 (file)
@@ -139,6 +139,16 @@ void DrawingWindow::fillCircle(int x, int y, int r)
     painter->setBrush(Qt::NoBrush);
 }
 
+void DrawingWindow::drawText(int x, int y, const char *text)
+{
+    QRect r(image->rect());
+    r.moveTo(x, y);
+    safeLock(imageMutex);
+    painter->drawText(r, 0, text, &r);
+    dirty(r);
+    safeUnlock(imageMutex);
+}
+
 bool DrawingWindow::sync(unsigned long time)
 {
     bool synced;
@@ -307,7 +317,7 @@ inline
 void DrawingWindow::dirty(int x1, int y1, int x2, int y2)
 {
     QRect r;
-    r.setCoords(x1, y1, x2, y2); // xy2 + 1 ???
+    r.setCoords(x1, y1, x2, y2);
     dirty(r.normalized());
 }