pytmx icon indicating copy to clipboard operation
pytmx copied to clipboard

Fixed issue where the visible attribute was not correctly converted t…

Open justinbeetle opened this issue 5 years ago • 1 comments

…o a boolean in TileImageLayer.

justinbeetle avatar Jan 04 '21 17:01 justinbeetle

Thanks been busy but I will take a look

On Fri, Feb 5, 2021 at 2:10 PM justinbeetle [email protected] wrote:

@justinbeetle commented on this pull request.

In pytmx/pytmx.py https://github.com/bitcraft/pytmx/pull/133#discussion_r571222371:

  •        :param node: ElementTree xml node
    
  •        :param node_type: Tag name of elements to find
    
  •        :return: Python list of ElementTree xml nodes
    
  •        """
    
  •        subnodes = []
    
  •        for subnode in node:
    
  •            if 'visible' in subnode.attrib and not convert_to_bool(subnode.attrib['visible']):
    
  •                continue
    
  •            if subnode.tag == node_type:
    
  •                subnodes.append(subnode)
    
  •            elif subnode.tag == 'group':
    
  •                subnodes += find_all_visible_nodes(subnode, node_type)
    
  •        return subnodes
    
  •    for subnode in find_all_visible_nodes(node, 'layer'):
           self.add_layer(TiledTileLayer(self, subnode))
    

This only adds visible layers while previously non-visible layers were also added. If there is utility in also adding the non-visible layers, it has been lost. It could be restored with additional changes.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bitcraft/pytmx/pull/133#pullrequestreview-584670899, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEH5JYPBAG2BTWWKT4KXLLS5RGCZANCNFSM4VTLCVBA .

bitcraft avatar Feb 05 '21 21:02 bitcraft