mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 15:29:32 +02:00
Fix color index for entity grid tool
This commit is contained in:
parent
eb69720af4
commit
0307448ec3
1 changed files with 5 additions and 2 deletions
|
@ -11,6 +11,7 @@
|
||||||
{ red: 0, green: 255, blue: 0},
|
{ red: 0, green: 255, blue: 0},
|
||||||
{ red: 0, green: 0, blue: 255 },
|
{ red: 0, green: 0, blue: 255 },
|
||||||
];
|
];
|
||||||
|
var gridColorIndex = 0;
|
||||||
|
|
||||||
elPosY = document.getElementById("horiz-y");
|
elPosY = document.getElementById("horiz-y");
|
||||||
elMinorSpacing = document.getElementById("minor-spacing");
|
elMinorSpacing = document.getElementById("minor-spacing");
|
||||||
|
@ -59,6 +60,7 @@
|
||||||
minorGridSpacing: elMinorSpacing.value,
|
minorGridSpacing: elMinorSpacing.value,
|
||||||
majorGridEvery: elMajorSpacing.value,
|
majorGridEvery: elMajorSpacing.value,
|
||||||
gridColor: gridColor,
|
gridColor: gridColor,
|
||||||
|
colorIndex: gridColorIndex,
|
||||||
snapToGrid: elSnapToGrid.checked,
|
snapToGrid: elSnapToGrid.checked,
|
||||||
visible: elHorizontalGridVisible.checked,
|
visible: elHorizontalGridVisible.checked,
|
||||||
}));
|
}));
|
||||||
|
@ -93,12 +95,13 @@
|
||||||
box.setAttribute('class', 'color-box');
|
box.setAttribute('class', 'color-box');
|
||||||
box.style.background = 'rgb(' + colors.red + ', ' + colors.green + ', ' + colors.blue + ')';
|
box.style.background = 'rgb(' + colors.red + ', ' + colors.green + ', ' + colors.blue + ')';
|
||||||
document.getElementById("grid-colors").appendChild(box);
|
document.getElementById("grid-colors").appendChild(box);
|
||||||
box.addEventListener("click", function(color) {
|
box.addEventListener("click", function(color, index) {
|
||||||
return function() {
|
return function() {
|
||||||
gridColor = color;
|
gridColor = color;
|
||||||
|
gridColorIndex = index;
|
||||||
emitUpdate();
|
emitUpdate();
|
||||||
}
|
}
|
||||||
}({ red: colors.red, green: colors.green, blue: colors.blue }));
|
}({ red: colors.red, green: colors.green, blue: colors.blue }, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
EventBridge.emitWebEvent(JSON.stringify({ type: 'init' }));
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'init' }));
|
||||||
|
|
Loading…
Reference in a new issue