在 TikZ 中裁剪矩形不起作用

在 TikZ 中裁剪矩形不起作用

我有这个代码:

\documentclass[tikz]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{comment}
\usepackage{tkz-euclide}
\usetkzobj{all} 
\tikzset{
b/.style={draw, rectangle, rounded corners=1.5ex,minimum height=0.4in, text width = .7in, minimum width=1in,align=center},
d/.style={draw, rectangle, rounded corners=1.5ex,minimum height=0.4in, text width = .5in, minimum width=.5in,align=center},
c/.style={draw, rectangle, rounded corners=1ex, minimum height=0.2in, minimum  width=.3in,align=center},
}
\usetikzlibrary{shapes.geometric,arrows,positioning,fit,calc,backgrounds}

\begin{document}
 \pgfmathsetseed{1}
   \begin{tikzpicture}
      \draw (0,.5) circle (0.2cm);
   \node[rectangle] (user) at (0, -1) {User};
   \draw (0,0.3) -- (0, -.2);
   \draw (-.1, .1) -- (.1, .1);
   \draw (0,-.2) -- (.12,-.6);
   \draw (0,-.2) -- (-.12, -.6);

   \node[b] (server) at(0, 2) {Server};

   \node (node1) at (4,4){};


   \node[b, above=6cm of user] (app) {App};



   \coordinate (a) at (app.north);
    \coordinate (c) at ($(node1.east) + (.3,0)$) ;
    \coordinate (b) at (server.east);  % modify the -1cm offset here

   % Draw the arc through the points
    \tkzCircumCenter(c,b,a)\tkzGetPoint{O}
    \tikzset{compass style/.append style={<-,thick,black}}
    \tkzDrawArc(O,b)(a) 

    \node[above=1cm of app] (abapp){};
    \node (righ) at ($(node1.east) + (1.2,0)$){Results};

    \node[left=12 of node1.center, text width = 2.5cm](scn) {};


    \node[draw, fill opacity=0.2,fill=blue, fit=(righ)(abapp)(scn)(user)] (fiter) {};

    \clip (fiter.south west) rectangle (fiter.north east);

   \end{tikzpicture}   

   \end{document}  

我得到了这个结果(蓝色矩形上方的白色是结果的一部分): 在此处输入图片描述

我怎样才能只打印蓝色部分(编译它以查看我的问题)?我用过,clip但不起作用。当我通过三个点绘制圆弧时会产生空白。

答案1

要删除空白,您可以使用

\pgfresetboundingbox
\path(fiter.south west) rectangle (fiter.north east);

代替

\clip (fiter.south west) rectangle (fiter.north east);

相关内容