mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
heightmap - fix issues
This commit is contained in:
parent
27a045b709
commit
ff31e23a27
5 changed files with 60 additions and 44 deletions
|
|
@ -136,7 +136,10 @@ function insertEditorHtml() {
|
|||
const templatesHtml = templates
|
||||
.map(({id, name}) => {
|
||||
Math.random = aleaPRNG(seed);
|
||||
|
||||
HeightmapGenerator.resetHeights();
|
||||
const heights = HeightmapGenerator.fromTemplate(id);
|
||||
HeightmapGenerator.cleanup();
|
||||
const dataUrl = drawHeights(heights);
|
||||
|
||||
return /* html */ `<article data-id="${id}" data-seed="${seed}">
|
||||
|
|
@ -224,7 +227,9 @@ function regeneratePreview(article, id) {
|
|||
article.dataset.seed = seed;
|
||||
Math.random = aleaPRNG(seed);
|
||||
|
||||
HeightmapGenerator.resetHeights();
|
||||
const heights = HeightmapGenerator.fromTemplate(id);
|
||||
HeightmapGenerator.cleanup();
|
||||
const dataUrl = drawHeights(heights);
|
||||
article.querySelector("img").src = dataUrl;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue