fix: disable double-click on heightmap edit

This commit is contained in:
Azgaar 2024-09-22 20:07:55 +02:00
parent b66874ddda
commit ea27276558
6 changed files with 16 additions and 11 deletions

View file

@ -673,6 +673,7 @@ input[type="color"]::-webkit-color-swatch-wrapper {
border: none;
padding: 0.45em 0.75em;
margin: 0.4em 0;
white-space: nowrap;
font-family: var(--monospace);
animation: glowing 2s infinite;
}
@ -2388,6 +2389,10 @@ svg.button {
}
}
#chat-widget-container {
user-select: none;
}
#chat-widget-minimized {
animation: fadeIn 1s ease-in;
transform: scale(0.65);

View file

@ -2418,9 +2418,7 @@
<div id="exitCustomization">
<div data-tip="Drag to move the pane">
<button data-tip="Finalize the heightmap and exit the edit mode" id="finalizeHeightmap">
Exit Customization
</button>
<button data-tip="Finalize the heightmap and exit the edit mode" id="finalizeHeightmap">Exit Customization</button>
</div>
</div>
@ -8074,14 +8072,14 @@
<script src="modules/ui/style-presets.js?v=1.100.00"></script>
<script src="modules/ui/general.js?v=1.100.00"></script>
<script src="modules/ui/options.js?v=1.105.0"></script>
<script src="main.js?v=1.105.0"></script>
<script src="main.js?v=1.105.2"></script>
<script defer src="modules/relief-icons.js?v=1.99.05"></script>
<script defer src="modules/ui/style.js?v=1.104.0"></script>
<script defer src="modules/ui/editors.js?v=1.104.3"></script>
<script defer src="modules/ui/editors.js?v=1.105.2"></script>
<script defer src="modules/ui/tools.js?v=1.104.0"></script>
<script defer src="modules/ui/world-configurator.js?v=1.104.0"></script>
<script defer src="modules/ui/heightmap-editor.js?v=1.104.9"></script>
<script defer src="modules/ui/heightmap-editor.js?v=1.105.2"></script>
<script defer src="modules/ui/provinces-editor.js?v=1.104.0"></script>
<script defer src="modules/ui/biomes-editor.js?v=1.99.05"></script>
<script defer src="modules/ui/namesbase-editor.js?v=1.99.00"></script>

View file

@ -170,7 +170,7 @@ let scale = 1;
let viewX = 0;
let viewY = 0;
function onZoom() {
const onZoom = debounce(function () {
const {k, x, y} = d3.event.transform;
const isScaleChanged = Boolean(scale - k);
@ -182,9 +182,8 @@ function onZoom() {
viewY = y;
handleZoom(isScaleChanged, isPositionChanged);
}
const onZoomDebouced = debounce(onZoom, 50);
const zoom = d3.zoom().scaleExtent([1, 20]).on("zoom", onZoomDebouced);
}, 50);
const zoom = d3.zoom().scaleExtent([1, 20]).on("zoom", onZoom);
// default options, based on Earth data
let options = {

View file

@ -8,6 +8,7 @@ function restoreDefaultEvents() {
svg.call(zoom);
viewbox.style("cursor", "default").on(".drag", null).on("click", clicked).on("touchmove mousemove", onMouseMove);
legend.call(d3.drag().on("start", dragLegendBox));
svg.call(zoom);
}
// handle viewbox click

View file

@ -112,7 +112,9 @@ function editHeightmap(options) {
layersPreset.value = "heightmap";
layersPreset.disabled = true;
mockHeightmap();
viewbox.on("touchmove mousemove", moveCursor);
svg.on("dblclick.zoom", null);
if (tool === "templateEditor") openTemplateEditor();
else if (tool === "imageConverter") openImageConverter();

View file

@ -12,7 +12,7 @@
*
* Example: 1.102.2 -> Major version 1, Minor version 102, Patch version 2
*/
const VERSION = "1.105.1";
const VERSION = "1.105.2";
if (parseMapVersion(VERSION) !== VERSION) alert("versioning.js: Invalid format or parsing function");
{