[lasem] svg_circle_element: implement get_exents.
- From: Emmanuel Pacaud <emmanuel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [lasem] svg_circle_element: implement get_exents.
- Date: Sun, 8 Aug 2010 13:27:34 +0000 (UTC)
commit a1ef998f2923a54c8238f19cbb571b95bc41bf6b
Author: Emmanuel Pacaud <emmanuel gnome org>
Date: Sun Aug 8 11:39:44 2010 +0200
svg_circle_element: implement get_exents.
src/lsmsvgcircleelement.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/lsmsvgcircleelement.c b/src/lsmsvgcircleelement.c
index 5358106..1cce8c4 100644
--- a/src/lsmsvgcircleelement.c
+++ b/src/lsmsvgcircleelement.c
@@ -53,6 +53,22 @@ lsm_svg_circle_element_render (LsmSvgElement *self, LsmSvgView *view)
lsm_svg_view_show_circle (view, cx, cy, r);
}
+static void
+lsm_svg_circle_element_get_extents (LsmSvgElement *self, LsmSvgView *view, LsmExtents *extents)
+{
+ LsmSvgCircleElement *circle = LSM_SVG_CIRCLE_ELEMENT (self);
+ double cx, cy, r;
+
+ cx = lsm_svg_view_normalize_length (view, &circle->cx.length, LSM_SVG_LENGTH_DIRECTION_HORIZONTAL);
+ cy = lsm_svg_view_normalize_length (view, &circle->cy.length, LSM_SVG_LENGTH_DIRECTION_VERTICAL);
+ r = lsm_svg_view_normalize_length (view, &circle->r.length, LSM_SVG_LENGTH_DIRECTION_DIAGONAL);
+
+ extents->x1 = cx - r;
+ extents->y1 = cy - r;
+ extents->x2 = cx + r;
+ extents->y2 = cy + r;
+}
+
/* LsmSvgCircleElement implementation */
LsmDomNode *
@@ -114,6 +130,7 @@ lsm_svg_circle_element_class_init (LsmSvgCircleElementClass *s_rect_class)
d_node_class->get_node_name = lsm_svg_circle_element_get_node_name;
s_element_class->render = lsm_svg_circle_element_render;
+ s_element_class->get_extents = lsm_svg_circle_element_get_extents;
s_element_class->attribute_manager = lsm_attribute_manager_duplicate (s_element_class->attribute_manager);
lsm_attribute_manager_add_attributes (s_element_class->attribute_manager,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]