1.1 --- a/resources/notugly.xsl Sun Nov 01 23:29:48 2015 +0100
1.2 +++ b/resources/notugly.xsl Tue Apr 11 22:43:39 2017 +0200
1.3 @@ -268,6 +268,8 @@
1.4 </xsl:call-template>
1.5 </xsl:copy>
1.6 </xsl:for-each>
1.7 + <!-- Handle labels. -->
1.8 + <xsl:apply-templates select="svg:text" />
1.9 </xsl:when>
1.10 <!-- Handle bare groups. -->
1.11 <xsl:otherwise>
1.12 @@ -291,7 +293,6 @@
1.13 <xsl:call-template name="node-outline">
1.14 <xsl:with-param name="current" select="*[1]"/>
1.15 <xsl:with-param name="style">shadow</xsl:with-param>
1.16 - <xsl:with-param name="first" select="true()"/>
1.17 </xsl:call-template>
1.18 </xsl:when>
1.19 <xsl:otherwise>
1.20 @@ -308,21 +309,10 @@
1.21
1.22 <xsl:choose>
1.23 <!-- Rewrite node outlines. -->
1.24 - <xsl:when test="$class='node' and svg:path">
1.25 - <xsl:for-each select="svg:path">
1.26 - <xsl:call-template name="node-outline">
1.27 - <xsl:with-param name="current" select="."/>
1.28 - <xsl:with-param name="first" select="true()"/>
1.29 - </xsl:call-template>
1.30 - </xsl:for-each>
1.31 - </xsl:when>
1.32 - <xsl:when test="$class='node' and svg:polyline">
1.33 - <xsl:for-each select="svg:polyline">
1.34 - <xsl:call-template name="node-outline">
1.35 - <xsl:with-param name="current" select="."/>
1.36 - <xsl:with-param name="first" select="true()"/>
1.37 - </xsl:call-template>
1.38 - </xsl:for-each>
1.39 + <xsl:when test="$class='node' and svg:path|svg:polyline">
1.40 + <xsl:call-template name="node-outline">
1.41 + <xsl:with-param name="current" select="*[1]"/>
1.42 + </xsl:call-template>
1.43 </xsl:when>
1.44 <xsl:otherwise>
1.45 <xsl:for-each select="svg:path">
1.46 @@ -331,6 +321,7 @@
1.47 </xsl:otherwise>
1.48 </xsl:choose>
1.49
1.50 + <!-- Handle labels. -->
1.51 <xsl:apply-templates select="svg:text" />
1.52 </xsl:template>
1.53
1.54 @@ -338,7 +329,6 @@
1.55 <xsl:param name="path-so-far"/>
1.56 <xsl:param name="current"/>
1.57 <xsl:param name="style"/>
1.58 - <xsl:param name="first" select="false()"/>
1.59
1.60 <xsl:choose>
1.61 <!-- Visit each child element, collecting the path details. -->
1.62 @@ -351,7 +341,6 @@
1.63 <xsl:with-param name="points" select="concat('C', substring-after($current/@d, 'C'))"/>
1.64 <xsl:with-param name="current" select="$current"/>
1.65 <xsl:with-param name="style" select="$style"/>
1.66 - <xsl:with-param name="include" select="$first"/>
1.67 </xsl:call-template>
1.68 </xsl:when>
1.69 <xsl:when test="local-name($current) = 'polyline'">
1.70 @@ -361,7 +350,6 @@
1.71 <xsl:with-param name="points" select="substring-after($current/@points, ' ')"/>
1.72 <xsl:with-param name="current" select="$current"/>
1.73 <xsl:with-param name="style" select="$style"/>
1.74 - <xsl:with-param name="include" select="$first"/>
1.75 </xsl:call-template>
1.76 </xsl:when>
1.77 <xsl:otherwise>
1.78 @@ -369,7 +357,6 @@
1.79 <xsl:with-param name="path-so-far" select="$path-so-far"/>
1.80 <xsl:with-param name="current" select="$current/following-sibling::*[1]"/>
1.81 <xsl:with-param name="style" select="$style"/>
1.82 - <xsl:with-param name="first" select="$first"/>
1.83 </xsl:call-template>
1.84 </xsl:otherwise>
1.85 </xsl:choose>
1.86 @@ -408,7 +395,6 @@
1.87 <xsl:param name="points"/>
1.88 <xsl:param name="current"/>
1.89 <xsl:param name="style"/>
1.90 - <xsl:param name="include" select="true()"/>
1.91
1.92 <xsl:variable name="next" select="substring-before($points, ' ')"/>
1.93 <xsl:variable name="remaining" select="substring-after($points, ' ')"/>
1.94 @@ -417,46 +403,23 @@
1.95 <!-- With path points remaining, include the current point if appropriate
1.96 and visit those remaining. -->
1.97 <xsl:when test="$remaining">
1.98 - <xsl:choose>
1.99 - <xsl:when test="$include">
1.100 - <xsl:call-template name="filter-path">
1.101 - <xsl:with-param name="path-so-far" select="concat($path-so-far, ' ', $point)"/>
1.102 - <xsl:with-param name="point" select="$next"/>
1.103 - <xsl:with-param name="points" select="$remaining"/>
1.104 - <xsl:with-param name="current" select="$current"/>
1.105 - <xsl:with-param name="style" select="$style"/>
1.106 - </xsl:call-template>
1.107 - </xsl:when>
1.108 - <xsl:otherwise>
1.109 - <xsl:call-template name="filter-path">
1.110 - <xsl:with-param name="path-so-far" select="$path-so-far"/>
1.111 - <xsl:with-param name="point" select="$next"/>
1.112 - <xsl:with-param name="points" select="$remaining"/>
1.113 - <xsl:with-param name="current" select="$current"/>
1.114 - <xsl:with-param name="style" select="$style"/>
1.115 - </xsl:call-template>
1.116 - </xsl:otherwise>
1.117 - </xsl:choose>
1.118 + <xsl:call-template name="filter-path">
1.119 + <xsl:with-param name="path-so-far" select="concat($path-so-far, ' ', $point)"/>
1.120 + <xsl:with-param name="point" select="$next"/>
1.121 + <xsl:with-param name="points" select="$remaining"/>
1.122 + <xsl:with-param name="current" select="$current"/>
1.123 + <xsl:with-param name="style" select="$style"/>
1.124 + </xsl:call-template>
1.125 </xsl:when>
1.126 <!-- With up to one remaining after this point, include the current point,
1.127 if appropriate, and the one remaining. -->
1.128 <xsl:otherwise>
1.129 - <xsl:choose>
1.130 - <xsl:when test="$include">
1.131 - <xsl:call-template name="node-outline">
1.132 - <xsl:with-param name="path-so-far" select="concat($path-so-far, ' ', $point, ' ', $points)"/>
1.133 - <xsl:with-param name="current" select="$current/following-sibling::*[1]"/>
1.134 - <xsl:with-param name="style" select="$style"/>
1.135 - </xsl:call-template>
1.136 - </xsl:when>
1.137 - <xsl:otherwise>
1.138 - <xsl:call-template name="node-outline">
1.139 - <xsl:with-param name="path-so-far" select="concat($path-so-far, ' ', $points)"/>
1.140 - <xsl:with-param name="current" select="$current/following-sibling::*[1]"/>
1.141 - <xsl:with-param name="style" select="$style"/>
1.142 - </xsl:call-template>
1.143 - </xsl:otherwise>
1.144 - </xsl:choose>
1.145 + <xsl:call-template name="node-outline">
1.146 + <xsl:with-param name="path-so-far" select="concat($path-so-far, ' ', $point, ' ', $points)"/>
1.147 + <xsl:with-param name="current" select="$current/following-sibling::*[1]"/>
1.148 + <xsl:with-param name="style" select="$style"/>
1.149 + <xsl:with-param name="last" select="$current"/>
1.150 + </xsl:call-template>
1.151 </xsl:otherwise>
1.152 </xsl:choose>
1.153 </xsl:template>
1.154 @@ -467,7 +430,6 @@
1.155 <xsl:param name="points"/>
1.156 <xsl:param name="current"/>
1.157 <xsl:param name="style"/>
1.158 - <xsl:param name="include" select="true()"/>
1.159
1.160 <xsl:variable name="next" select="substring-before($points, ' ')"/>
1.161 <xsl:variable name="remaining" select="substring-after($points, ' ')"/>
1.162 @@ -476,46 +438,23 @@
1.163 <!-- With path points remaining, include the current point if appropriate
1.164 and visit those remaining. -->
1.165 <xsl:when test="$remaining">
1.166 - <xsl:choose>
1.167 - <xsl:when test="$include">
1.168 - <xsl:call-template name="polyline-to-path">
1.169 - <xsl:with-param name="path-so-far" select="concat($path-so-far, ' ', $point)"/>
1.170 - <xsl:with-param name="point" select="concat('L', $next)"/>
1.171 - <xsl:with-param name="points" select="$remaining"/>
1.172 - <xsl:with-param name="current" select="$current"/>
1.173 - <xsl:with-param name="style" select="$style"/>
1.174 - </xsl:call-template>
1.175 - </xsl:when>
1.176 - <xsl:otherwise>
1.177 - <xsl:call-template name="polyline-to-path">
1.178 - <xsl:with-param name="path-so-far" select="$path-so-far"/>
1.179 - <xsl:with-param name="point" select="concat('L', $next)"/>
1.180 - <xsl:with-param name="points" select="$remaining"/>
1.181 - <xsl:with-param name="current" select="$current"/>
1.182 - <xsl:with-param name="style" select="$style"/>
1.183 - </xsl:call-template>
1.184 - </xsl:otherwise>
1.185 - </xsl:choose>
1.186 + <xsl:call-template name="polyline-to-path">
1.187 + <xsl:with-param name="path-so-far" select="concat($path-so-far, ' ', $point)"/>
1.188 + <xsl:with-param name="point" select="concat('L', $next)"/>
1.189 + <xsl:with-param name="points" select="$remaining"/>
1.190 + <xsl:with-param name="current" select="$current"/>
1.191 + <xsl:with-param name="style" select="$style"/>
1.192 + </xsl:call-template>
1.193 </xsl:when>
1.194 <!-- With up to one remaining after this point, include the current point,
1.195 if appropriate, and the one remaining. -->
1.196 <xsl:otherwise>
1.197 - <xsl:choose>
1.198 - <xsl:when test="$include">
1.199 - <xsl:call-template name="node-outline">
1.200 - <xsl:with-param name="path-so-far" select="concat($path-so-far, ' ', $point, ' L', $points)"/>
1.201 - <xsl:with-param name="current" select="$current/following-sibling::*[2]"/>
1.202 - <xsl:with-param name="style" select="$style"/>
1.203 - </xsl:call-template>
1.204 - </xsl:when>
1.205 - <xsl:otherwise>
1.206 - <xsl:call-template name="node-outline">
1.207 - <xsl:with-param name="path-so-far" select="concat($path-so-far, ' L', $points)"/>
1.208 - <xsl:with-param name="current" select="$current/following-sibling::*[1]"/>
1.209 - <xsl:with-param name="style" select="$style"/>
1.210 - </xsl:call-template>
1.211 - </xsl:otherwise>
1.212 - </xsl:choose>
1.213 + <xsl:call-template name="node-outline">
1.214 + <xsl:with-param name="path-so-far" select="concat($path-so-far, ' ', $point, ' L', $points)"/>
1.215 + <xsl:with-param name="current" select="$current/following-sibling::*[1]"/>
1.216 + <xsl:with-param name="style" select="$style"/>
1.217 + <xsl:with-param name="last" select="$current"/>
1.218 + </xsl:call-template>
1.219 </xsl:otherwise>
1.220 </xsl:choose>
1.221 </xsl:template>