Skip to content

Commit

Permalink
Switched inkex.unittouu to self.unittouu
Browse files Browse the repository at this point in the history
As per this fix sambody#9 (comment)
  • Loading branch information
Tasty213 authored Nov 15, 2019
1 parent 05f4741 commit 3eff6c6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions extensions/add_centered_guides.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ def effect(self):
svg = self.document.getroot()

# getting the width and height attributes of the canvas
canvas_width = inkex.unittouu(svg.get('width'))
canvas_height = inkex.unittouu(svg.attrib['height'])
canvas_width = self.unittouu(svg.get('width'))
canvas_height = self.unittouu(svg.attrib['height'])

# calculate center of document
center_pos_x = canvas_width/2
Expand Down
8 changes: 4 additions & 4 deletions extensions/add_grid_guides.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def effect(self):
# columns

# Factor to multiply in order to get value in user units (pixels)
col_factor = inkex.unittouu('1' + self.options.column_unit)
col_factor = self.unittouu('1' + self.options.column_unit)
col_alignment = self.options.column_alignment
col_offset = float(self.options.column_offset) * col_factor
cols = int(self.options.columns)
Expand All @@ -248,7 +248,7 @@ def effect(self):
show_total_width = self.options.show_total_width

# rows
row_factor = inkex.unittouu('1' + self.options.row_unit)
row_factor = self.unittouu('1' + self.options.row_unit)
row_alignment = self.options.row_alignment
row_offset = float(self.options.row_offset) * row_factor
rows = int(self.options.rows)
Expand All @@ -263,8 +263,8 @@ def effect(self):

# main SVG document element (canvas)
svg = self.document.getroot()
canvas_width = inkex.unittouu(svg.get('width'))
canvas_height = inkex.unittouu(svg.attrib['height'])
canvas_width = self.unittouu(svg.get('width'))
canvas_height = self.unittouu(svg.attrib['height'])

# total width (columns and gutters)
if has_outer_col_gutter:
Expand Down
6 changes: 3 additions & 3 deletions extensions/add_margin_guides.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def effect(self):
# Get script's options values. Input.

# Factor to multiply in order to get user units (pixels)
factor = inkex.unittouu('1' + self.options.unit)
factor = self.unittouu('1' + self.options.unit)

# boolean
same_margins = self.options.same_margins
Expand All @@ -129,8 +129,8 @@ def effect(self):
svg = self.document.getroot()

# getting the width and height attributes of the canvas
canvas_width = inkex.unittouu(svg.get('width'))
canvas_height = inkex.unittouu(svg.get('height'))
canvas_width = self.unittouu(svg.get('width'))
canvas_height = self.unittouu(svg.get('height'))

# Get selection bounding box - TODO

Expand Down

1 comment on commit 3eff6c6

@Tasty213
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed all instances of inkex.unittouu to self.unittouu` as per sambody#13

Please sign in to comment.