From 45b89294c8a1be6f4f6c2289356f3eb538bd24a7 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sat, 17 Mar 2018 23:49:56 +0000 Subject: [PATCH] chemtext: Add hydrate dot (see https://forum.lazarus.freepascal.org/index.php/topic,40519.msg279939.html) git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6253 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/chemtext/source/chemtext.pas | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/chemtext/source/chemtext.pas b/components/chemtext/source/chemtext.pas index 421a92789..37151441b 100644 --- a/components/chemtext/source/chemtext.pas +++ b/components/chemtext/source/chemtext.pas @@ -134,6 +134,7 @@ const SUBFONT_DIVISOR = 100; ARROW_LINE: array[boolean] of char = ('-', '='); ESCAPE_CHAR = '\'; + HYDRATE_DOT = #$E2#$80#$A2; function ChemTextHeight(ACanvas: TCanvas; const AText: String; Arrow: TChemArrow = caAsciiSingle): Integer; @@ -314,6 +315,12 @@ begin subNos := false; end; + '.': + begin + subNos := false; + DrawNormal(X, Y, HYDRATE_DOT); + end; + ESCAPE_CHAR: escaping := true; @@ -321,7 +328,7 @@ begin begin j := i+1; while (j <= Length(AText)) and - not (AText[j] in ['0'..'9', '+', '-', '<', ESCAPE_CHAR]) + not (AText[j] in ['0'..'9', '+', '-', '<', '.', ESCAPE_CHAR]) do inc(j); s := Copy(AText, i, j-i);