Przeglądaj źródła

respect keyedit_precision_attention setting when converting from old (((attention))) syntax

AUTOMATIC1111 1 rok temu
rodzic
commit
2f6ea8b103
1 zmienionych plików z 2 dodań i 0 usunięć
  1. 2 0
      javascript/edit-attention.js

+ 2 - 0
javascript/edit-attention.js

@@ -86,6 +86,8 @@ function keyupEditAttention(event) {
                 weight = (1 / 1.1) ** numParen;
             }
 
+            weight = Math.round(weight / opts.keyedit_precision_attention) * opts.keyedit_precision_attention;
+
             text = text.slice(0, selectionStart - numParen) + "(" + text.slice(selectionStart, selectionEnd) + ":" + weight + ")" + text.slice(selectionEnd + numParen);
             selectionStart -= numParen - 1;
             selectionEnd -= numParen - 1;