summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-eu-draw-lines.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-eu-draw-lines.tex')
-rw-r--r--Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-eu-draw-lines.tex69
1 files changed, 32 insertions, 37 deletions
diff --git a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-eu-draw-lines.tex b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-eu-draw-lines.tex
index 0e3e9f60965..41c11c1c66d 100644
--- a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-eu-draw-lines.tex
+++ b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-eu-draw-lines.tex
@@ -10,9 +10,9 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\def\fileversion{4.00}
-\def\filedate{2022/01/04}
-\typeout{2022/01/04 4.00 tkz-obj-eu-draw-lines.tex}
+\def\fileversion{4.03}
+\def\filedate{2022/01/19}
+\typeout{2022/01/19 4.03 tkz-obj-eu-draw-lines.tex}
\makeatletter
\def\tkz@numdl{0}
@@ -218,7 +218,8 @@
% \draw[dim={7cm,10pt,transform shape}] (B) -- (C);
% \draw[dim={X,,}] (A) -- (C);
%<--------------------------------------------------------------------------–>
-% code from muzimuzhi Z
+% new code from muzimuzhi Z
+%https://tex.stackexchange.com/questions/553430/change-color-and-style-of-dimension-lines-in-tkz-euclide/553441
\pgfkeys{/pgf/decoration/.cd, distance/.initial = 10pt}
@@ -243,41 +244,35 @@
\pgfpathlineto{\pgfpoint{\pgfdecoratedpathlength}{0pt}}
}}
+
\tikzset{
- dim/.style args={#1,#2,#3}{%
- decoration = {add dim,distance=\ifx&#2&0pt\else#2\fi},
- decorate,
- postaction = {%
- decorate,
- decoration={%
- raise=#2,
- markings,
- mark=at position .5 with {%
- \node[inner sep=0pt,
- font=\footnotesize,
- fill=\tkz@fillcolor,
- #3] at (0,0) {#1};}
- }
- }
- },
- dim/.default={,0pt,}
-}
-\tikzset{
- dim color/.store in=\tkz@dim@color,
- dim color=black,
- % similar to code for \tikzoption{dash pattern}{...}
- dim dash pattern/.code={%
- \def\tikz@temp{#1}%
- \ifx\tikz@temp\pgfutil@empty%
- \def\tkz@dim@dashpattern{{}{0pt}}%
- \else%
- \def\tikz@dashpattern{}%
- \expandafter\tikz@scandashon\pgfutil@gobble#1o\@nil%
- \edef\tkz@dim@dashpattern{{\tikz@dashpattern}{\noexpand\tikz@dashphase}}%
- \fi
+ dim/.style args={#1,#2,#3}{%
+ postaction={
+ decoration={
+ show path construction,
+ lineto code={
+ % dim fence
+ \draw[dim fence style/.try]
+ (\tikzinputsegmentfirst) --
+ ($ (\tikzinputsegmentfirst)!1.2*(#2)!90:(\tikzinputsegmentlast) $)
+ (\tikzinputsegmentlast) --
+ ($ (\tikzinputsegmentlast)!1.2*(#2)!-90:(\tikzinputsegmentfirst) $);
+ % dim
+ \draw[dim style/.try]
+ ($ (\tikzinputsegmentfirst)!#2!90:(\tikzinputsegmentlast) $) --
+ node[inner sep=0pt, font=\footnotesize, fill=\tkz@fillcolor, pos=.5, #3] {#1}
+ ($ (\tikzinputsegmentlast)!#2!-90:(\tikzinputsegmentfirst) $);
+ }
+ },
+ decorate,
+ }
},
- dim dash pattern=,
-}
+ dim/.default={,0pt,},
+ dim style/.style={
+ latex-latex,
+ },
+}
+
%<--------------------------- style line --------------------------------->
\tikzset{add/.style args={#1 and #2}{to path={%
($(\tikztostart)!-#1!(\tikztotarget)$)--($(\tikztotarget)!-#2!(\tikztostart)$)%