Skip to content

Commit

Permalink
The horizontal guides were drawn at the wrong position
Browse files Browse the repository at this point in the history
  • Loading branch information
DerElam committed Jun 22, 2021
1 parent ad798ce commit aa32f60
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions PlayingCards.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,19 +550,6 @@ def document_height(self):
"""
return self.document.getroot().get("height")

def y_inkscape_to_svg(self, y):
"""
Transform an inkscape coordinate to and svg coordinate.
The origin in inkscape is the bottom left corner of the page. The
origin in svg is the top left cornder of the page. Therefore the
y coordinate needs to be transformed.
:param y: the y coordinate in user units
:type y: float
"""
return float(self.to_user_unit(self.document_height())) - y;

def calculate_positions(self):
"""
Calculate the horizontal and vertical positions of all cards.
Expand Down Expand Up @@ -667,7 +654,7 @@ def create_guide(self, x, y, orientation):
view = self.document.getroot().find(inkex.addNS("namedview", "sodipodi"))
guide = etree.SubElement(view, inkex.addNS("guide", "sodipodi"))
guide.set("orientation", orientation)
guide.set("position", "{0},{1}".format(x, self.y_inkscape_to_svg(y)))
guide.set("position", "{0},{1}".format(x, y))

def create_horizontal_guide(self, y):
"""
Expand Down

0 comments on commit aa32f60

Please sign in to comment.