fix: the proof crops the finest stroke and closes the contact wait (0.1)
The browser records where the thinnest stroke sits in the assembled film; the proof takes a 15 cm window around it instead of always the top. A free proof no longer fails the layout's billed-metres check, and answering the proof card clears "Aguardando contato" and ends its timer.
This commit is contained in:
@@ -46,7 +46,18 @@ function perguntaMista(){
|
||||
// O traço mais fino do item (item 9, Dropstar 30/10/2026): o menor entre as
|
||||
// folhas que o navegador mediu. Não aparece para o cliente; vai para a sala,
|
||||
// que confere a classe de contração ao aprovar o arquivo final.
|
||||
function tracoDoItem(lista){
|
||||
// Onde o traço mais fino cai no filme montado (0 no topo, 1 no fim): a prova
|
||||
// de 15 cm é recortada em volta dele, não no começo da folha (item 0.1).
|
||||
function fracaoNoFilme(layout,sourceIndex,fraction){
|
||||
if(!layout || !(layout.height_cm>0)) return fraction||0;
|
||||
const placement=(layout.placements||[]).find(p=>p.source_index===sourceIndex);
|
||||
if(!placement) return fraction||0;
|
||||
const y=placement.rotation_degrees%180===90
|
||||
? placement.y_cm+placement.length_cm/2
|
||||
: placement.y_cm+(fraction||0)*placement.length_cm;
|
||||
return Math.max(0,Math.min(1,y/layout.height_cm));
|
||||
}
|
||||
function tracoDoItem(lista,layout){
|
||||
const arquivos=lista||(ehFolha()?folhas:artes);
|
||||
const medidas=arquivos.map((x,index)=>({index,traco:lista?tracoDaArte(x):tracoDoArquivo(x)})).filter(x=>x.traco);
|
||||
if(!medidas.length) return {strokePx:null, strokeClass:null, strokeChoice:null};
|
||||
@@ -54,7 +65,8 @@ function tracoDoItem(lista){
|
||||
// Avisado do item 16, o cliente quis imprimir assim: fica a medida, C1.
|
||||
const avisado=arquivos.some(x=>x.mistaVista && mista(lista?tracoDaArte(x):tracoDoArquivo(x)));
|
||||
return {strokePx:fino.traco.px, strokeClass:fino.traco.classe, strokeChoice:avisado?'measured':null,
|
||||
proofSourceIndex:fino.index, proofYFraction:fino.traco.proofYFraction||0};
|
||||
proofSourceIndex:fino.index,
|
||||
proofYFraction:fracaoNoFilme(lista?layout:montagemLayout,fino.index,fino.traco.proofYFraction||0)};
|
||||
}
|
||||
// Avalia sozinho conforme o cliente sobe e preenche. Devolve o que ainda falta,
|
||||
// para a fila dizer em texto em vez de travar num botão.
|
||||
|
||||
Reference in New Issue
Block a user