annotate src/shape_rect.c @ 757:f43224bf3524

Remove unused variables and refactor to X_MB_init_with_win
author Thinker K.F. Li <thinker@codemud.net>
date Thu, 26 Aug 2010 17:54:11 +0800
parents 16116d84bc5e
children 586e50f82c1f
rev   line source
33
d82749f77108 Fix bug of demo and remove *_fill() and *_stroke().
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
1 #include <stdio.h>
35
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
2 #include <stdlib.h>
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
3 #include <string.h>
186
530bb7728546 Move header files to $(top_srcdir)/include/ and prefixed with 'mb_'.
Thinker K.F. Li <thinker@branda.to>
parents: 185
diff changeset
4 #include "mb_types.h"
530bb7728546 Move header files to $(top_srcdir)/include/ and prefixed with 'mb_'.
Thinker K.F. Li <thinker@branda.to>
parents: 185
diff changeset
5 #include "mb_shapes.h"
33
d82749f77108 Fix bug of demo and remove *_fill() and *_stroke().
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
6
d82749f77108 Fix bug of demo and remove *_fill() and *_stroke().
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
7 typedef struct _sh_rect {
d82749f77108 Fix bug of demo and remove *_fill() and *_stroke().
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
8 shape_t shape;
d82749f77108 Fix bug of demo and remove *_fill() and *_stroke().
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
9 co_aix x, y;
35
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
10 co_aix w, h;
33
d82749f77108 Fix bug of demo and remove *_fill() and *_stroke().
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
11 co_aix rx, ry;
35
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
12 co_aix poses[12][2];
33
d82749f77108 Fix bug of demo and remove *_fill() and *_stroke().
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
13 } sh_rect_t;
d82749f77108 Fix bug of demo and remove *_fill() and *_stroke().
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
14
73
9ab15ebc9061 Observer for mouse events
Thinker K.F. Li <thinker@branda.to>
parents: 40
diff changeset
15 static void sh_rect_free(shape_t *shape) {
9ab15ebc9061 Observer for mouse events
Thinker K.F. Li <thinker@branda.to>
parents: 40
diff changeset
16 free(shape);
9ab15ebc9061 Observer for mouse events
Thinker K.F. Li <thinker@branda.to>
parents: 40
diff changeset
17 }
9ab15ebc9061 Observer for mouse events
Thinker K.F. Li <thinker@branda.to>
parents: 40
diff changeset
18
159
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
19 shape_t *rdman_shape_rect_new(redraw_man_t *rdman,
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
20 co_aix x, co_aix y, co_aix w, co_aix h,
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
21 co_aix rx, co_aix ry) {
35
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
22 sh_rect_t *rect;
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
23
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
24 rect = (sh_rect_t *)malloc(sizeof(sh_rect_t));
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
25 if(rect == NULL)
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
26 return NULL;
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
27
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
28 memset(rect, 0, sizeof(sh_rect_t));
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
29
224
29e1b2bffe4c X backend only sent EVT_MOUSE_MOVE_RAW to MadButterfly.
Thinker K.F. Li <thinker@branda.to>
parents: 196
diff changeset
30 mb_obj_init(rect, MBO_RECT);
35
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
31 rect->x = x;
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
32 rect->y = y;
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
33 rect->w = w;
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
34 rect->h = h;
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
35 rect->rx = rx;
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
36 rect->ry = ry;
73
9ab15ebc9061 Observer for mouse events
Thinker K.F. Li <thinker@branda.to>
parents: 40
diff changeset
37 rect->shape.free = sh_rect_free;
35
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
38
159
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
39 rdman_shape_man(rdman, (shape_t *)rect);
b90abd31a281 Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
40
35
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
41 return (shape_t *)rect;
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
42 }
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
43
40
Thinker K.F. Li <thinker@branda.to>
parents: 36
diff changeset
44 void sh_rect_set(shape_t *shape, co_aix x, co_aix y,
Thinker K.F. Li <thinker@branda.to>
parents: 36
diff changeset
45 co_aix w, co_aix h, co_aix rx, co_aix ry) {
Thinker K.F. Li <thinker@branda.to>
parents: 36
diff changeset
46 sh_rect_t *rect = (sh_rect_t *)shape;
Thinker K.F. Li <thinker@branda.to>
parents: 36
diff changeset
47
Thinker K.F. Li <thinker@branda.to>
parents: 36
diff changeset
48 rect->x = x;
Thinker K.F. Li <thinker@branda.to>
parents: 36
diff changeset
49 rect->y = y;
Thinker K.F. Li <thinker@branda.to>
parents: 36
diff changeset
50 rect->w = w;
Thinker K.F. Li <thinker@branda.to>
parents: 36
diff changeset
51 rect->h = h;
Thinker K.F. Li <thinker@branda.to>
parents: 36
diff changeset
52 rect->rx = rx;
Thinker K.F. Li <thinker@branda.to>
parents: 36
diff changeset
53 rect->ry = ry;
Thinker K.F. Li <thinker@branda.to>
parents: 36
diff changeset
54 }
Thinker K.F. Li <thinker@branda.to>
parents: 36
diff changeset
55
35
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
56 void sh_rect_transform(shape_t *shape) {
34
07c523c799f4 Fix bug of relative path command
Thinker K.F. Li <thinker@branda.to>
parents: 33
diff changeset
57 sh_rect_t *rect = (sh_rect_t *)shape;
35
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
58 co_aix x, y, w, h, rx, ry;
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
59 co_aix (*poses)[2];
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
60 co_aix width;
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
61 area_t *area;
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
62 int i;
34
07c523c799f4 Fix bug of relative path command
Thinker K.F. Li <thinker@branda.to>
parents: 33
diff changeset
63
35
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
64 x = rect->x;
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
65 y = rect->y;
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
66 w = rect->w;
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
67 h = rect->h;
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
68 rx = rect->rx;
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
69 ry = rect->ry;
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
70
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
71 poses = rect->poses;
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
72
36
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
73 if(rect->rx != 0 && rect->ry != 0) {
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
74 poses[0][0] = x + w - rx;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
75 poses[0][1] = y;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
76 poses[1][0] = x + w;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
77 poses[1][1] = y;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
78 poses[2][0] = x + w;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
79 poses[2][1] = y + ry;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
80
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
81 poses[3][0] = x + w;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
82 poses[3][1] = y + h - ry;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
83 poses[4][0] = x + w;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
84 poses[4][1] = y + h;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
85 poses[5][0] = x + w - rx;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
86 poses[5][1] = y + h;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
87
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
88 poses[6][0] = x + rx;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
89 poses[6][1] = y + h;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
90 poses[7][0] = x;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
91 poses[7][1] = y + h;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
92 poses[8][0] = x;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
93 poses[8][1] = y + h - ry;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
94
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
95 poses[9][0] = x;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
96 poses[9][1] = y + ry;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
97 poses[10][0] = x;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
98 poses[10][1] = y;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
99 poses[11][0] = x + rx;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
100 poses[11][1] = y;
35
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
101
36
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
102 for(i = 0; i < 12; i++)
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
103 coord_trans_pos(shape->coord, &poses[i][0], &poses[i][1]);
35
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
104
36
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
105 geo_from_positions(shape->geo, 12, poses);
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
106 } else {
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
107 poses[0][0] = x;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
108 poses[0][1] = y;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
109 poses[1][0] = x + w;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
110 poses[1][1] = y;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
111 poses[2][0] = x + w;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
112 poses[2][1] = y + h;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
113 poses[3][0] = x;
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
114 poses[3][1] = y + h;
35
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
115
36
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
116 for(i = 0; i < 4; i++)
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
117 coord_trans_pos(shape->coord, &poses[i][0], &poses[i][1]);
35
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
118
36
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
119 geo_from_positions(shape->geo, 4, poses);
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
120 }
35
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
121
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
122 if(shape->stroke) {
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
123 area = shape->geo->cur_area;
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
124 width = shape->stroke_width;
270
cd6af7da32c9 Fix the problem that clean_canvas() can not clean canvas cleanly.
Thinker K.F. Li <thinker@branda.to>
parents: 224
diff changeset
125 area->x -= width / 2 + 0.5;
cd6af7da32c9 Fix the problem that clean_canvas() can not clean canvas cleanly.
Thinker K.F. Li <thinker@branda.to>
parents: 224
diff changeset
126 area->y -= width / 2 + 0.5;
cd6af7da32c9 Fix the problem that clean_canvas() can not clean canvas cleanly.
Thinker K.F. Li <thinker@branda.to>
parents: 224
diff changeset
127 area->w += width + 1;
cd6af7da32c9 Fix the problem that clean_canvas() can not clean canvas cleanly.
Thinker K.F. Li <thinker@branda.to>
parents: 224
diff changeset
128 area->h += width + 1;
35
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
129 }
34
07c523c799f4 Fix bug of relative path command
Thinker K.F. Li <thinker@branda.to>
parents: 33
diff changeset
130 }
35
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
131
448
16116d84bc5e Replace Cairo with a abstract layer mb_graph_engine.
Thinker K.F. Li <thinker@branda.to>
parents: 270
diff changeset
132 void sh_rect_draw(shape_t *shape, mbe_t *cr) {
35
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
133 sh_rect_t *rect = (sh_rect_t *)shape;
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
134 int i;
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
135 co_aix (*poses)[2];
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
136
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
137 poses = rect->poses;
36
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
138 if(rect->rx != 0 && rect->ry != 0) {
448
16116d84bc5e Replace Cairo with a abstract layer mb_graph_engine.
Thinker K.F. Li <thinker@branda.to>
parents: 270
diff changeset
139 mbe_move_to(cr, poses[11][0], poses[11][1]);
36
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
140 for(i = 0; i < 12; i += 3) {
448
16116d84bc5e Replace Cairo with a abstract layer mb_graph_engine.
Thinker K.F. Li <thinker@branda.to>
parents: 270
diff changeset
141 mbe_line_to(cr, poses[i][0], poses[i][1]);
16116d84bc5e Replace Cairo with a abstract layer mb_graph_engine.
Thinker K.F. Li <thinker@branda.to>
parents: 270
diff changeset
142 mbe_curve_to(cr,
36
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
143 poses[i + 1][0], poses[i + 1][1],
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
144 poses[i + 1][0], poses[i + 1][1],
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
145 poses[i + 2][0], poses[i + 2][1]);
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
146 }
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
147 } else {
448
16116d84bc5e Replace Cairo with a abstract layer mb_graph_engine.
Thinker K.F. Li <thinker@branda.to>
parents: 270
diff changeset
148 mbe_move_to(cr, poses[3][0], poses[3][1]);
36
51a20f240ce3 short-cut for no-rounded rectangle
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
149 for(i = 0; i < 4; i++)
448
16116d84bc5e Replace Cairo with a abstract layer mb_graph_engine.
Thinker K.F. Li <thinker@branda.to>
parents: 270
diff changeset
150 mbe_line_to(cr, poses[i][0], poses[i][1]);
35
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
151 }
581a03196093 Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents: 34
diff changeset
152 }