small enhancement in % placement

This commit is contained in:
Mario Voigt 2021-10-21 02:21:01 +02:00
parent 8c7bcc3e95
commit daa9194606
2 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@
<param name="link_count" type="int" min="1" max="9999" gui-text="Link count">1</param>
<param name="link_multiplicator" type="int" min="0" max="9999" gui-text="Link multiplicator" gui-description="If set, we create a set of multiple gaps of same size next to the main gap">0</param>
<param name="length_link" type="float" min="0.000" max="9999.000" precision="3" gui-text="Link length (the length of the gap)">1.000</param>
<param name="link_offset" type="float" min="-9999.000" max="9999.000" precision="3" appearance="full" gui-text="Link offset (+/-)">0.000</param>
<param name="link_offset" type="float" min="-9999.000" max="9999.000" precision="3" appearance="full" gui-text="Link offset (+/-)" gui-description="If you selected '%' as creation unit, enter values 0..100. The link will be placed in the middle">0.000</param>
<param name="switch_pattern" type="bool" gui-text="Swap links with dashes" gui-description="If enabled, we use gap length as dash length (switches the dasharray pattern).">false</param>
<label appearance="header">Creation: Custom Dash Pattern Settings</label>
<param name="custom_dasharray_value" type="string" gui-text="Dash pattern" gui-description="A list of separated lengths that specify the lengths of alternating dashes and gaps. Input only accepts numbers. It ignores percentages or other characters.">10 5.5 2.0 2.0</param>

View File

@ -153,7 +153,7 @@ class LinksCreator(inkex.EffectExtension):
return False if self.options.skip_errors is True else exit(1)
if self.options.creationunit == "percent":
stroke_dashoffset = self.options.link_offset / 100.0
stroke_dashoffset = (self.options.link_offset / 100.0 * stotal) - length_link/2
else:
stroke_dashoffset = self.svg.unittouu(str(self.options.link_offset) + self.options.creationunit)