Closed euginium closed 3 years ago
You will need to clean the ctx everytime you start to create a new edition in the loop function.
On Thu, 26 Aug 2021, 12:46 pm Euginium @.***> wrote:
This issue is also found in the first version of the program .
The first edition of the image is clean. However, when it come to the 2nd edition of the image, the 1st edition can still be seen beneath the 2nd edition.
How do we fix it?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/HashLips/generative-art-opensource/issues/3, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVAXZL3EBRAYBS6DDPTUBXTT6YLPDANCNFSM5C3CG7FA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .
How do I clear it? Sorry I'm a newbie Thanks for the help.
No worries. You can run this after the image has saved.
ctx.clearRect(0,0,width,height);
On Thu, 26 Aug 2021, 1:12 pm Euginium @.***> wrote:
How do I clear it? Sorry I'm a newbie Thanks for the help.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/HashLips/generative-art-opensource/issues/3#issuecomment-906312147, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVAXZLYPCWR335LV5ZU4V2TT6YOR5ANCNFSM5C3CG7FA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .
Change:
let mappedDnaToLayers = _layers.map((layer) => { let selectedElement = layer.elements[parseInt(DnaSegment) % layer.elements.length]; return { location: layer.location, position: layer.position, size: layer.size, selectedElement: selectedElement, }; });
To:
let mappedDnaToLayers = _layers.map((layer, index) => { let selectedElement = layer.elements[parseInt(DnaSegment[index]) % layer.elements.length]; return { location: layer.location, position: layer.position, size: layer.size, selectedElement: selectedElement, }; });
This issue is also found in the first version of the program .
The first edition of the image is clean. However, when it come to the 2nd edition of the image, the 1st edition can still be seen beneath the 2nd edition.
How do we fix it?