@@ -1094,7 +1094,7 @@ class svg_render_use : public render_obj_base
10941094
10951095 void get_xlink (void ) const
10961096 {
1097- if (!m_linked) {
1097+ if (!m_linked && m_xlink ) {
10981098 render_obj_base* head = m_head;
10991099 while (head) {
11001100 if (head->id () && strcmp (m_xlink, head->id ()) == 0 ) {
@@ -1264,8 +1264,12 @@ class svg_render_content : public render_obj_base
12641264 {
12651265 }
12661266
1267- virtual void render_content (ps_context* ctx, ps_path* contents, ps_matrix* offset_matrix, float yoffset)
1267+ virtual void render_content (ps_context* ctx, ps_path* contents, ps_matrix* offset_matrix, float yoffset, bool rebuild_path )
12681268 {
1269+ if (!rebuild_path) {
1270+ return ;
1271+ }
1272+
12691273 ps_path* glyph_path = ps_path_create ();
12701274
12711275 ps_matrix* mtx = ps_matrix_create_copy (offset_matrix);
@@ -1348,19 +1352,21 @@ class svg_render_text : public render_obj_base
13481352 ps_font_info info;
13491353 ps_get_font_info (ctx, &info);
13501354
1355+ bool build_path = false ;
13511356 if (ps_path_is_empty (m_path)) {
1352- // FIXME: text and span redraw !!!!!!!!!!!!!!!!!
1353- ps_matrix* mtx = ps_matrix_create ();
1354- ps_matrix_translate (mtx, m_x, m_y);
1355-
1356- // draw text contents and spans
1357- for (uint32_t i = 0 ; i < psx_array_size (&m_contents); i++) {
1358- svg_render_content* content = *(psx_array_get (&m_contents, i, svg_render_content*));
1359- content->render_content (ctx, m_path, mtx, -info.ascent );
1360- }
1361- ps_matrix_unref (mtx);
1357+ build_path = true ;
13621358 }
13631359
1360+ ps_matrix* mtx = ps_matrix_create ();
1361+ ps_matrix_translate (mtx, m_x, m_y);
1362+
1363+ // draw text contents and spans
1364+ for (uint32_t i = 0 ; i < psx_array_size (&m_contents); i++) {
1365+ svg_render_content* content = *(psx_array_get (&m_contents, i, svg_render_content*));
1366+ content->render_content (ctx, m_path, mtx, -info.ascent , build_path);
1367+ }
1368+ ps_matrix_unref (mtx);
1369+
13641370 ps_set_font (ctx, old_font);
13651371
13661372 ps_set_path (ctx, m_path);
@@ -1454,7 +1460,7 @@ class svg_render_tspan : public svg_render_content
14541460 this ->svg_render_tspan ::~svg_render_tspan ();
14551461 }
14561462
1457- virtual void render_content (ps_context* ctx, ps_path*, ps_matrix* offset_matrix, float )
1463+ virtual void render_content (ps_context* ctx, ps_path*, ps_matrix* offset_matrix, float , bool )
14581464 {
14591465 ps_save (ctx);
14601466 prepare (ctx);
0 commit comments