From 4c9c9668bb29ba0d15f2698f440e22f825229dbc Mon Sep 17 00:00:00 2001 From: Ad5001 Date: Mon, 7 Mar 2022 03:10:51 +0100 Subject: [PATCH] Adding comment to disableLatex, allowing for symbols in content. --- .../qml/eu/ad5001/LogarithmPlotter/js/objs/text.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/text.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/text.js index edfa9f5..c5dd846 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/text.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/text.js @@ -21,6 +21,8 @@ .import "common.js" as Common .import "../mathlib.js" as MathLib .import "../parameters.js" as P +.import "../math/latex.js" as Latex + class Text extends Common.DrawableObject { @@ -38,7 +40,11 @@ class Text extends Common.DrawableObject { [QT_TRANSLATE_NOOP('prop','y')]: 'Expression', [QT_TRANSLATE_NOOP('prop','labelPosition')]: P.Enum.Positioning, [QT_TRANSLATE_NOOP('prop','text')]: 'string', - [QT_TRANSLATE_NOOP('prop','disableLatex')]: 'boolean' + 'comment1': QT_TRANSLATE_NOOP( + 'comment', + 'If you have latex enabled, you can use use latex markup in between $$ to create equations.' + ), + [QT_TRANSLATE_NOOP('prop','disableLatex')]: 'boolean' }} constructor(name = null, visible = true, color = null, labelContent = 'null', @@ -60,7 +66,7 @@ class Text extends Common.DrawableObject { } latexMarkupText() { - let txt = this.text + let txt = Latex.variable(this.text) let i for(i = 0; txt.includes('$$'); i++) if(i & 0x01) // Every odd number