From 5b66035c443c4b2291401bb5b20d717a20fed65a Mon Sep 17 00:00:00 2001 From: PelzaK Date: Wed, 8 Mar 2023 19:50:33 +0100 Subject: [PATCH] fix Overzealous rounding #12 --- mapper.html | 22 ++++++++++++++++------ package.json | 2 +- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/mapper.html b/mapper.html index 8d0fc36..91b762a 100644 --- a/mapper.html +++ b/mapper.html @@ -33,7 +33,8 @@ ] }, - snapToGrid: {value: false} + snapToGrid: {value: false}, + displayRoundedInput: {value: true} }, inputs: 1, outputs: 1, @@ -241,7 +242,8 @@ if(rounding === -1) rounding = 8 - $('#editor-position-tooltip').css({left: target.x + 64, top: target.y + 128, opacity: .9}).html(`IN OUT `) + let displayRoundedInput = $("#node-input-displayRoundedInput").is(':checked') + $('#editor-position-tooltip').css({left: target.x + 64, top: target.y + 128, opacity: .9}).html(`IN OUT `) $('#editor-position-tooltip #editor-x').on('input', onKeyframeEditorChange) $('#editor-position-tooltip #editor-y').on('input', onKeyframeEditorChange) editedKeyframe = keyframe @@ -410,7 +412,8 @@ if(rounding === -1) rounding = 8 - $('#editor-position-tooltip').css({left: posX + 48, top: posY + 128, opacity: .9}).html(`${x.toFixed(rounding)}, ${y.toFixed(rounding)}`) + let displayRoundedInput = $("#node-input-displayRoundedInput").is(':checked') + $('#editor-position-tooltip').css({left: posX + 48, top: posY + 128, opacity: .9}).html(`${displayRoundedInput ? x.toFixed(rounding) : x}, ${y.toFixed(rounding)}`) } function onMouseMove(e) @@ -649,9 +652,15 @@ -
- - +
+
+ + +
+
+ + +
@@ -731,4 +740,5 @@

Overview

You can also disable rounding.

The editor can be divided to a custom number of grid lines (dark edit controls).

Snap to grid option will do a snapping when keyframe is being dragged

+

Display rounded input option will round input value in a tooltip and a keyframe editor window

\ No newline at end of file diff --git a/package.json b/package.json index 9fbb0ab..effdb56 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "node-red-contrib-visualmapper", "description": "Maps input to output value with multiple editable sections and graphical editor.", - "version": "0.4.0", + "version": "0.5.0", "main": "mapper.js", "keywords": [ "node-red",