KonradLinkowski / GeneticDrawer

image evolution algorithm
https://konradlinkowski.github.io/GeneticDrawer/
10 stars 10 forks source link

Image swap with drag and drop #5

Closed asfo closed 3 years ago

asfo commented 3 years ago

Closes #4

@KonradLinkowski I'm getting an issue here:

Sometimes this happens:

Uncaught TypeError: Failed to execute 'putImageData' on 'CanvasRenderingContext2D': parameter 1 is not of type 'ImageData'.
    at iteration

But sometimes it works, so I don't know what is happening actually since I don't have the knowledge of the "ImageData" usage.

I know its related to the iteration function that is not restarting the image sometimes, but don't know what is happening actually, so if you can fix it, I already did everything else.

Hope this is okay.

KonradLinkowski commented 3 years ago

I will look at this

KonradLinkowski commented 3 years ago

Looks good, but there is an error in my code. I will merge this to a feature branch and add my changes. Then I will merge this into master.

KonradLinkowski commented 3 years ago

@asfo It appears that you didn't check your changes on mobile Before: image After: image The dropzone itself is ok, but you forgot to handle input event. You don't have to check if there are multiple files, because the input file only allows one file if you don't add multiple attribute. And adding a accept attribute is handy here. I will use your commit, but change a lot, but it will take me some time. You can make a mobile version for this if you want to. I'm not the best with css.