Could anyone help me solve this problem?
Are you asking how to round the values? Maybe this?
myInput.value = Math.round(mySlider.value * 100) / 100;
I believe it’s about UI and value being cut off on the far right outside of dialog window
Exactly this problem. here is the code.
I would like to thank my noble colleagues for their attention.
const dialogimpress = document.getElementById('tamImpress');
const impresDial = document.getElementById('impressDialog');
dialogimpress.addEventListener('click', () => {
impresDial.show({title: "Tratamento para impressão",resize: "both",size: { width: 250, height: 200}});
});
const abrirSlid = document.getElementById('abrirSlid');
const SlidModal = document.getElementById('DiaSld');
const desfoqueSlider = document.getElementById('desfoque');
const texturaSlider = document.getElementById('textura');
const btnClose = document.getElementById('aplyin');
// Função assíncrona com a lógica que você quer executar antes da abertura da janela
const abrirPeleMod = async () => {
await core.executeAsModal(async () => {
// Sua lógica aqui
app.batchPlay([], {});
});
};
abrirSlid.addEventListener('click', async () => {
// Chama a função assíncrona antes de abrir a janela dialog
desfoqueSlider.value = 0.1;
texturaSlider.value = 0.1;
await abrirPeleMod();
SlidModal.show({title: "Tratamento de pele",resize: "both",size: { width: 350, height: 200}});
btnClose.onclick = function() {
core.executeAsModal(async () => {
// Sua lógica aqui
app.batchPlay([], {});
});
SlidModal.close()
}
});
document.querySelector('#Corrigir').addEventListener('click', async () => {
await core.executeAsModal(async () => {
await app.batchPlay([{"_obj":"select","_target":[{"_name":"Pele Manual02","_ref":"layer"}],"makeVisible":false},
{"_obj":"select","_target":[{"_ref":"paintbrushTool"}]}], {});
})
});
const slDesfoque = document.querySelector("#desfoque");
slDesfoque.addEventListener("change", async (func) => {
document.querySelector("#vDesf").innerHTML = slDesfoque.value
await suavPele(slDesfoque.value);
})
///////////////////////////
async function suavPele(Textura){
async function suavPele() {
await batchPlay( [ {"_obj":"set","_target":[{"_index":2,"_ref":"filterFX"},{"_ref":"layer",_name: "AjustPele", _value: "targetEnum"}],"filterFX":{"_obj":"filterFX","filter":{"_obj":"highPass","radius":{"_unit":"pixelsUnit","_value":Textura}}}} ],
{ modalBehavior: "wait" } );
}
async function runModalFunction() {await executeAsModal(suavPele);}
await runModalFunction();
}
const slTextura = document.querySelector("#textura");
slTextura.addEventListener("change", async (func) => {
document.querySelector("#vTextur").innerHTML = slTextura.value
await textura(slTextura.value);
})
///////////////////////////
async function textura(Desfoque){
async function textura() {
await batchPlay( [{"_obj":"set","_target":[{"_index":3,"_ref":"filterFX"},{"_ref":"layer",_name: "AjustPele", _value: "targetEnum"}],"filterFX":{"_obj":"filterFX","filter":{"_obj":"gaussianBlur","radius":{"_unit":"pixelsUnit","_value":Desfoque}}}}],
{ modalBehavior: "wait" } );
}
async function runModalFunction() {await executeAsModal(textura);}
await runModalFunction();
}
Here is the modified code and my sincere thanks.
const slDesfoque = document.querySelector("#desfoque");
slDesfoque.addEventListener("change", async (func) => {
const roundedValue = Math.round(slDesfoque.value * 10) / 10; // Arredonda para uma casa decimal
document.querySelector("#vDesf").innerHTML = roundedValue;
await suavPele(roundedValue);
})
///////////////////////////
async function suavPele(Textura){
async function suavPele() {
await batchPlay( [ {"_obj":"set","_target":[{"_index":2,"_ref":"filterFX"},{"_ref":"layer",_name: "AjustPele", _value: "targetEnum"}],"filterFX":{"_obj":"filterFX","filter":{"_obj":"highPass","radius":{"_unit":"pixelsUnit","_value":Textura}}}} ],
{ modalBehavior: "wait" } );
}
async function runModalFunction() {await executeAsModal(suavPele);}
await runModalFunction();
}
const slTextura = document.querySelector("#textura");
slTextura.addEventListener("change", async (func) => {
const roundedValue = Math.round(slTextura.value * 10) / 10; // Arredonda para uma casa decimal
document.querySelector("#vTextur").innerHTML = roundedValue;
await textura(roundedValue);;
})
///////////////////////////
async function textura(Desfoque){
async function textura() {
await batchPlay( [{"_obj":"set","_target":[{"_index":3,"_ref":"filterFX"},{"_ref":"layer",_name: "AjustPele", _value: "targetEnum"}],"filterFX":{"_obj":"filterFX","filter":{"_obj":"gaussianBlur","radius":{"_unit":"pixelsUnit","_value":Desfoque}}}}],
{ modalBehavior: "wait" } );
}
async function runModalFunction() {await executeAsModal(textura);}
await runModalFunction();
}