From 3928caef5de354b892c83c4fdb848c73b4a48317 Mon Sep 17 00:00:00 2001 From: Artem Proskurnev Date: Fri, 2 Jul 2021 00:40:24 +0300 Subject: [PATCH] =?UTF-8?q?Delay.=20=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC?= =?UTF-8?q?=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D0=B5=20=D0=B2=D1=80=D0=B5=D0=BC?= =?UTF-8?q?=D1=8F=20=D0=B4=D0=BB=D1=8F=20=D1=81=D0=BE=D0=B1=D1=8B=D1=82?= =?UTF-8?q?=D0=B8=D0=B9=20=D1=80=D0=B0=D0=B2=D0=BD=D0=BE=20=D0=BE=D0=B6?= =?UTF-8?q?=D0=B8=D0=B4=D0=B0=D0=BD=D0=B8=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 5 +++++ qtsgraph.cpp | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 92e3112..5862858 100644 --- a/main.cpp +++ b/main.cpp @@ -22,6 +22,11 @@ void QTSGraph::PaintBox() // Начало рисования //ShowAxes(); + Circle(100, 100, 20); + Delay(1000); + Circle(200, 200, 20); + Delay(10); + Circle(300, 300, 20); SetColor(clGreen); Line(0, 0, 600, 600); SetColor(0xFF0000); diff --git a/qtsgraph.cpp b/qtsgraph.cpp index b580aa3..e45ae2b 100644 --- a/qtsgraph.cpp +++ b/qtsgraph.cpp @@ -42,7 +42,7 @@ void QTSGraph::Delay(int ms) { QTime dieTime= QTime::currentTime().addMSecs(ms); while (QTime::currentTime() < dieTime) - QCoreApplication::processEvents(QEventLoop::AllEvents, 50); + QCoreApplication::processEvents(QEventLoop::AllEvents, ms); } void QTSGraph::Ellipse(int x1, int y1, int x2, int y2) @@ -191,7 +191,7 @@ TPixel QTSGraph::ReadMousePosition() TPixel t; t.x = MouseMovePosition.x(); t.y = MouseMovePosition.y(); - t.color = Canvas.toImage().pixelColor(t.x, t.y).rgba() % 0x1000000; + t.color = GetPixel(t.x, t.y); if(SwapYAxis) t.y = Canvas.height() - t.y - 1; if(MoveOtoCenter) { @@ -206,7 +206,7 @@ TPixel QTSGraph::GetLastMouseClickPosition() TPixel t; t.x = LastMouseClickPosition.x(); t.y = LastMouseClickPosition.y(); - t.color = Canvas.toImage().pixelColor(t.x, t.y).rgba() % 0x1000000; + t.color = GetPixel(t.x, t.y); if(SwapYAxis) t.y = Canvas.height() - t.y - 1; if(MoveOtoCenter) {