Closed ddemile closed 1 year ago
I fixed it by doing that :
def pastegeo(self):
try:
pos = [math.floor((pg.mouse.get_pos()[0] - self.field.rect.x) / self.size),
math.floor((pg.mouse.get_pos()[1] - self.field.rect.y) / self.size)]
self.emptyarea()
geodata = eval(pyperclip.paste())
if type(geodata) != list:
return
for xi, x in enumerate(geodata):
for yi, y in enumerate(x):
xpos = -self.xoffset + xi
ypos = -self.yoffset + yi
if (self.replaceair and y[0] == 0) or not self.canplaceit(xpos, ypos, xpos, ypos):
continue
self.data["GE"][-self.xoffset + xi + pos[0]][-self.yoffset + yi + pos[1]][self.layer] = y
self.area[-self.xoffset + xi + pos[0]][-self.yoffset + yi + pos[1]] = 0
self.detecthistory(["GE"])
self.renderer.geo_render_area(self.area, self.layer)
self.rfa()
except:
print("Error pasting data!")
good idea! will be added to all copy-paste parts
Hello, it would be cool if when we do ctrl+v the selection is copied to the mouse cursor