From 061037ab676fe7e59a4bc62bc1eaefd4c71fc7ac Mon Sep 17 00:00:00 2001 From: Edouard Dupin Date: Wed, 9 Nov 2011 18:06:40 +0100 Subject: [PATCH] Draw now a simple circle --- Sources/ewolOObject2DColored.cpp | 61 ++++++++++++++++++++++++++++++-- Sources/widget/ewolTest.cpp | 19 ++++++++++ 2 files changed, 78 insertions(+), 2 deletions(-) diff --git a/Sources/ewolOObject2DColored.cpp b/Sources/ewolOObject2DColored.cpp index 33b969ca..873bb9a4 100644 --- a/Sources/ewolOObject2DColored.cpp +++ b/Sources/ewolOObject2DColored.cpp @@ -185,7 +185,60 @@ void ewol::OObject2DColored::Rectangle(float x, float y, float w, float h) void ewol::OObject2DColored::Circle(float x, float y, float radius, float thickness) { - + coord2D_ts point; + if (radius<0) { + radius *= -1; + } + if (radius < thickness/2) { + Disc(x, y, thickness/2 + radius); + } + int32_t nbOcurence = radius*2; + if (nbOcurence < 10) + { + nbOcurence = 10; + } + for (int32_t iii=0; iiiSetColor(0.0, 1.0, 0.0, 0.5); tmpOObjects->Disc(200, 100, 300); } + tmpOObjects->SetColor(0.0, 0.0, 0.0, 1.0); + if (0 == m_elementID) { + tmpOObjects->Circle(100, 100, 10, 3); + } else if (1 == m_elementID) { + tmpOObjects->Circle(100, 100, 20, 3); + } else if (2 == m_elementID) { + tmpOObjects->Circle(100, 100, 30, 2); + } else if (3 == m_elementID) { + tmpOObjects->Circle(100, 100, 40, 1); + } else if (4 == m_elementID) { + tmpOObjects->Circle(100, 100, 50, 0.5); + } else if (5 == m_elementID) { + tmpOObjects->Circle(100, 100, 100, 25); + } else if (6 == m_elementID) { + tmpOObjects->Circle(100, 100, 100, 35); + } else { + tmpOObjects->Circle(100, 100, 100, 50); + } + AddOObject(tmpOObjects, "BouttonDecoration");