Skip to content

Commit

Permalink
Merge pull request #2546 from Alex-developer/dev
Browse files Browse the repository at this point in the history
Fix for manually entering x and y coordinates
  • Loading branch information
Alex-developer authored Apr 19, 2023
2 parents fd07af9 + 5dc7e52 commit 106b352
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions html/js/overlay/oe-uimanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -1645,6 +1645,9 @@ class OEUIMANAGER {
stroke: ''
};

let gridSizeX = this.#configManager.gridSize;
let gridSizeY = this.#configManager.gridSize;

var textConfig = {
label: { group: 'Label', name: 'Item', type: 'text' },
format: { group: 'Label', name: 'Format', type: 'text', helpcallback: function (name) {
Expand All @@ -1654,8 +1657,8 @@ class OEUIMANAGER {
sample: { group: 'Label', name: 'Sample', type: 'text' },
empty: { group: 'Label', name: 'Empty Value', type: 'text' },

x: { group: 'Position', name: 'X', type: 'number', options: { min: 0, max: 2048, step: 10 } },
y: { group: 'Position', name: 'Y', type: 'number', options: { min: 0, max: 2048, step: 10 } },
x: { group: 'Position', name: 'X', type: 'number', options: { min: 0, max: 2048, step: gridSizeX } },
y: { group: 'Position', name: 'Y', type: 'number', options: { min: 0, max: 2048, step: gridSizeY } },
rotation: { group: 'Position', name: 'Rotation', type: 'number', options: { min: -360, max: 360, step: 1 } },

fontname: { group: 'Font', name: 'Name', type: 'options', options: this.#fonts },
Expand Down Expand Up @@ -1689,6 +1692,10 @@ class OEUIMANAGER {
// TODO: Check setter actually exists

if (name == 'x' || name == 'y') {
if (value == '') {
value = 0;
}
value = parseInt(value)
if (name == 'x') {
field.x = value + field.shape.offsetX()
} else {
Expand Down

0 comments on commit 106b352

Please sign in to comment.