This commit is contained in:
Frank DeMarco 2014-01-20 01:10:52 +09:00
parent b5fb01b56a
commit b74c5e6d5a
1 changed files with 2 additions and 2 deletions

View File

@ -362,7 +362,7 @@ class GUI(GameChild):
def get_function_coordinates(self, xp=0, yp=0):
nodeset = self.get_nodeset()
(x_min, y_min), (x_max, y_max) = nodeset[0], nodeset[-1]
x_min, x_max, (y_min, y_max) = nodeset[0].x, nodeset[-1].x, self.yrange
rect = self.plot_rect
x = float(xp) / (rect.right - rect.left) * (x_max - x_min) + x_min
y = float(yp) / (rect.bottom - rect.top) * (y_min - y_max) + y_max
@ -376,7 +376,7 @@ class GUI(GameChild):
def get_plot_coordinates(self, x=0, y=0):
nodeset = self.get_nodeset()
(x_min, y_min), (x_max, y_max) = nodeset[0], nodeset[-1]
x_min, x_max, (y_min, y_max) = nodeset[0].x, nodeset[-1].x, self.yrange
x_ratio = float(x - x_min) / (x_max - x_min)
rect = self.plot_rect
xp = x_ratio * (rect.right - rect.left) + rect.left