y range
This commit is contained in:
parent
b5fb01b56a
commit
b74c5e6d5a
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue