aboutsummaryrefslogtreecommitdiff
path: root/src/graph/PS/fillarc.ps
blob: e0e62133c488b86bfd692611fa47ce1b6f74e749 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
% operand stack configuration in order to use psFillArc:
%		psFillArc
%		y center of rectangle
%		x center of rectangle
%		angle2
%		angle1
%		width
%		height
%		y
%		x
%		graphics-context dictionary
% this draws and fills an arc whose origin is at x, y, and whose width
% and height specifies the rectangle which encases the arc.
% Origin is at upper left corner of rectangle.
% This function uses "scale" to make cricles and ellipses.
/psFillArc
        {	gsave
		yVal moveto
                newpath
                /sfactor 4 index 4 index div def
                1 sfactor scale
                6 5 roll			%%	 x on top of stack
                3 index 2 div add               %% define x origin
                6 5 roll			%%	 y on top of stack
                6 5 roll			%%	 h on top of stack
                2 div add yVal sfactor div      %% define y origin
                5 4 roll			%%	 w on top of stack
                2 div                           %% define radius
                5 3 roll			%%	 a1 a2 now on top
                1 index add
                arc                             %% draw clockwise arc
                begin installGC fill end	%% fills with foreground color
                grestore }
        def