aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dw/bullet.cc2
-rw-r--r--dw/fltkviewbase.cc8
-rw-r--r--dw/fltkviewbase.hh2
-rw-r--r--dw/types.cc6
-rw-r--r--dw/view.hh2
5 files changed, 9 insertions, 11 deletions
diff --git a/dw/bullet.cc b/dw/bullet.cc
index 2534e07c..af7f5451 100644
--- a/dw/bullet.cc
+++ b/dw/bullet.cc
@@ -57,7 +57,7 @@ void Bullet::draw (core::View *view, core::Rectangle *area)
case core::style::LIST_STYLE_TYPE_DISC:
default:
view->drawArc (getStyle()->color, core::style::Color::SHADING_NORMAL,
- filled, x, y, l, l, 0, 360);
+ filled, x + l/2, y + l/2, l, l, 0, 360);
}
}
diff --git a/dw/fltkviewbase.cc b/dw/fltkviewbase.cc
index 437c109a..7d519f05 100644
--- a/dw/fltkviewbase.cc
+++ b/dw/fltkviewbase.cc
@@ -401,13 +401,13 @@ void FltkViewBase::drawRectangle (core::style::Color *color,
void FltkViewBase::drawArc (core::style::Color *color,
core::style::Color::Shading shading, bool filled,
- int x, int y, int width, int height,
+ int centerX, int centerY, int width, int height,
int angle1, int angle2)
{
setcolor(((FltkColor*)color)->colors[shading]);
- int x1 = translateCanvasXToViewX (x);
- int y1 = translateCanvasYToViewY (y);
- ::fltk::Rectangle rect (x1, y1, width, height);
+ int x = translateCanvasXToViewX (centerX) - width / 2;
+ int y = translateCanvasYToViewY (centerY) - height / 2;
+ ::fltk::Rectangle rect (x, y, width, height);
addchord(rect, angle1, angle2);
closepath();
if (filled)
diff --git a/dw/fltkviewbase.hh b/dw/fltkviewbase.hh
index ba4cc6d2..5e1981f8 100644
--- a/dw/fltkviewbase.hh
+++ b/dw/fltkviewbase.hh
@@ -77,7 +77,7 @@ public:
int x, int y, int width, int height);
void drawArc (core::style::Color *color,
core::style::Color::Shading shading, bool filled,
- int x, int y, int width, int height,
+ int centerX, int centerY, int width, int height,
int angle1, int angle2);
void drawPolygon (core::style::Color *color,
core::style::Color::Shading shading,
diff --git a/dw/types.cc b/dw/types.cc
index 3bc78ded..672ec7f6 100644
--- a/dw/types.cc
+++ b/dw/types.cc
@@ -142,11 +142,9 @@ void Circle::draw (core::View *view, core::style::Style *style, int x, int y)
{
const bool filled = false;
- /* drawArc() wants x, y, w, h for a rectangle, and then it draws the arc
- * inside that */
view->drawArc(style->color, core::style::Color::SHADING_NORMAL, filled,
- x + this->x - this->radius, y + this->y - this->radius,
- 2 * this->radius, 2 * this->radius, 0, 360);
+ x + this->x, y + this->y, 2 * this->radius, 2 * this->radius,
+ 0, 360);
}
bool Circle::isPointWithin (int x, int y)
diff --git a/dw/view.hh b/dw/view.hh
index 00a07a35..d0f6c6b9 100644
--- a/dw/view.hh
+++ b/dw/view.hh
@@ -171,7 +171,7 @@ public:
int x, int y, int width, int height) = 0;
virtual void drawArc (style::Color *color,
style::Color::Shading shading, bool filled,
- int x, int y, int width, int height,
+ int centerX, int centerY, int width, int height,
int angle1, int angle2) = 0;
virtual void drawPolygon (style::Color *color,
style::Color::Shading shading,