chrxh / alien

ALIEN is a CUDA-powered artificial life simulation program.
https://alien-project.org
BSD 3-Clause "New" or "Revised" License
3.48k stars 106 forks source link

Zooming causes the cells selected to be displaced #89

Closed sophxine closed 6 months ago

sophxine commented 7 months ago

When you zoom in or out while selecting cells and moving them the cells are displaced unexpectedly when not moving them. Zooming causes the cells to be moved. This also makes the cursor be at a different position than the selected cells.

chrxh commented 7 months ago

It's not clear to me how to reproduce the bug: How can you zoom, select and move cells at the same time?

sophxine commented 6 months ago

To reproduce the bug do:

  1. Select a group of cells
  2. Move the cells
  3. Use the mouse wheel while holding the left mouse button The more you move the cells before zooming in or out the more it becomes displaced.
chrxh commented 6 months ago

Hm, I still could not reproduce it: https://github.com/chrxh/alien/assets/73127001/61997450-04e5-4d14-a6df-432c5364a037

Did I do anything differently than in your description?

sophxine commented 6 months ago

Oh it doesn't happen when you have it paused.

chrxh commented 6 months ago

I was able to reproduce the bug. It's fixed in https://github.com/chrxh/alien/commit/cb1a98f0b3dab39b60c7b03ceb968f35fb56f5ab (see https://github.com/chrxh/alien/assets/73127001/a2bbed96-b859-4970-b246-3939656c8743) The fix will be contained in the next update.