@@ -78,9 +78,9 @@ function helper_shapes(x, y, cmd; Vd=0, kw...)
7878 # Helper function that takes care to all symbols plotting
7979 d = KW (kw)
8080 # Se if we are asked to force the start a new drawing (first= true) or bypass the CTRLshapes.first control
81- first = find_in_dict (d, [:first ])[1 ]
82- (( isa ( first, Bool) && first) || ( isa (first, Int) && first != 0 )) && (CTRLshapes . first[ 1 ] = true )
83- (( isa (first, Bool) && ! first) || ( isa (first, Int) && first == 0 )) && ( CTRLshapes. first[1 ] = false )
81+ _first = find_in_dict (d, [:first ])[1 ]
82+ first = (_first != = nothing ) && (_first == 1 )
83+ CTRLshapes. first[1 ] = first
8484
8585 if (CTRLshapes. first[1 ])
8686 CTRLshapes. fname[1 ] = PSname[1 ]
@@ -103,12 +103,13 @@ function helper_shapes(x, y, cmd; Vd=0, kw...)
103103 end
104104 (opt_B == DEF_FIG_AXES[1 ]) && (opt_B = " " ) # We don't want a default -B here
105105 opt_O, opt_P = " " , " -P"
106- out, opt_T, EXT, = GMT. fname_out (d)
107106 else
108107 opt_R, opt_J, opt_B, opt_O, opt_P = " -R" , " -J" , " " , " -O" , " "
109108 (CTRLshapes. points[1 ]) && (cmd *= " --PROJ_LENGTH_UNIT=p" )
110109 end
111110
111+ out, opt_T, EXT, fname, = GMT. fname_out (d, true )
112+
112113 redirect = (CTRLshapes. first[1 ]) ? " > " : " >> "
113114 if (length (kw) == 0 )
114115 cmd = " psxy" * cmd * opt_R * opt_J * opt_B * opt_P * opt_O * " -K" * redirect * CTRLshapes. fname[1 ]
@@ -119,6 +120,7 @@ function helper_shapes(x, y, cmd; Vd=0, kw...)
119120 d[:B ] = " none"
120121 cmd = GMT. common_plot_xyz (" " , nothing , cmd, CTRLshapes. first[1 ], false ; d... )
121122 (CTRLshapes. first[1 ] && opt_B != " " ) && (cmd = replace (cmd, " psxy" => " psxy" * opt_B))
123+ cmd = GMT. finish_PS (d, cmd, out, true , ! first)
122124 end
123125 (0 < Vd < 2 ) && println (cmd); (Vd > 1 ) && return cmd
124126
@@ -136,7 +138,6 @@ function helper_shapes(x, y, cmd; Vd=0, kw...)
136138
137139 CTRLshapes. first[1 ] = true # Better reset it right now in case next command errors
138140 CTRLshapes. points[1 ] = false
139- out, opt_T, EXT, fname, = GMT. fname_out (d, true )
140141 # show_non_consumed(d, cmd)
141142 close_PS_file (CTRLshapes. fname[1 ])
142143 showfig (d, CTRLshapes. fname[1 ], EXT, opt_T, false , fname)
0 commit comments