[gtk/path-work-rebased: 106/121] Special-case circles for strokes
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/path-work-rebased: 106/121] Special-case circles for strokes
- Date: Sun, 5 Dec 2021 03:59:04 +0000 (UTC)
commit 3c56f326fc3e5dff12b820c6a2b1c900c6abb4b4
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Dec 13 22:42:09 2020 -0500
Special-case circles for strokes
The outline of a circle is just two circles.
gsk/gskcontour.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
---
diff --git a/gsk/gskcontour.c b/gsk/gskcontour.c
index 29f50f50fd..3683915c36 100644
--- a/gsk/gskcontour.c
+++ b/gsk/gskcontour.c
@@ -888,6 +888,23 @@ gsk_circle_contour_add_stroke (const GskContour *contour,
GskPathBuilder *builder,
GskStroke *stroke)
{
+ const GskCircleContour *self = (const GskCircleContour *) contour;
+
+ if (stroke->dash_length == 0 &&
+ fabs (self->start_angle - self->end_angle) >= 360)
+ {
+ GskContour *c;
+
+ c = gsk_circle_contour_new (&self->center, self->radius + stroke->line_width / 2,
+ self->start_angle,
+ self->end_angle);
+ gsk_path_builder_add_contour (builder, c);
+
+ c = gsk_circle_contour_new (&self->center, self->radius - stroke->line_width / 2,
+ self->end_angle,
+ self->start_angle);
+ gsk_path_builder_add_contour (builder, c);
+ }
}
static const GskContourClass GSK_CIRCLE_CONTOUR_CLASS =
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]