Mercurial > MadButterfly
comparison pyink/domview.py @ 1328:407f321f0d7c
Add a svg:use after transform a group to a component
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Mon, 31 Jan 2011 12:47:49 +0800 |
parents | ab281ec3eeec |
children | 5da64f67d00d |
comparison
equal
deleted
inserted
replaced
1327:ab281ec3eeec | 1328:407f321f0d7c |
---|---|
500 pass | 500 pass |
501 | 501 |
502 layer_group = self._get_group_of_component_layer(comp_name, 0) | 502 layer_group = self._get_group_of_component_layer(comp_name, 0) |
503 layer_group.appendChild(group) | 503 layer_group.appendChild(group) |
504 pass | 504 pass |
505 | |
506 ## \brief Create a link to a component. | |
507 # | |
508 # \param parent_group is where the link will be pliaced in. | |
509 # \return link node. | |
510 # | |
511 def link_to_component(self, comp_name, parent_group): | |
512 layers_group = self._get_layers_group_of_component(comp_name) | |
513 | |
514 use_node = self._doc.createElement('svg:use') | |
515 layers_group_id = layers_group.getAttribute('id') | |
516 use_node.setAttribute('xlink:href', '#' + layers_group_id) | |
517 use_node_id = self.new_id() | |
518 use_node.setAttribute('id', use_node_id) | |
519 use_node.setAttribute('use_component', 'true') | |
520 | |
521 parent_group.appendChild(use_node) | |
522 | |
523 return use_node | |
505 pass | 524 pass |
506 | 525 |
507 | 526 |
508 ## \brief Monitor changes of DOM-tree. | 527 ## \brief Monitor changes of DOM-tree. |
509 # | 528 # |